You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(site-selector) prevent set current site undefined #32019 (#33204)
This pull request improves the robustness of the `SiteService` in
`core-web/libs/dotcms-js/src/lib/core/site.service.ts` by ensuring that
only valid (non-null/undefined) site objects are processed in key
methods. This helps prevent potential errors caused by invalid site data
being emitted or used.
**Improvements for site data validation and type safety:**
* Added the `filter` operator to RxJS pipelines in several methods
(`requestCurrentSite`, `getCurrentSite`, and `loadCurrentSite`) to
ensure only truthy (valid) `site` objects are processed.
[[1]](diffhunk://#diff-ebec7159cb4a8660492c16c6797f79029bb5fedea93d4bbad8f44c84729ca61cR193)
[[2]](diffhunk://#diff-ebec7159cb4a8660492c16c6797f79029bb5fedea93d4bbad8f44c84729ca61cL206-R207)
[[3]](diffhunk://#diff-ebec7159cb4a8660492c16c6797f79029bb5fedea93d4bbad8f44c84729ca61cL225-R229)
* Updated the type of the `urls` property to a more specific object
structure for better type safety.
* Included the `filter` operator in the RxJS import statement.
0 commit comments