diff --git a/src/Models/ThemeViewState.ts b/src/Models/ThemeViewState.ts index 5ec6203ce..d3168508d 100644 --- a/src/Models/ThemeViewState.ts +++ b/src/Models/ThemeViewState.ts @@ -994,7 +994,7 @@ export default class ThemeViewState implements SpecialVisualizationState { }) - this.layerState.filteredLayers.get("favourite").isDisplayed.addCallbackAndRunD(favouritesShown => { + this.layerState.filteredLayers.get("favourite")?.isDisplayed?.addCallbackAndRunD(favouritesShown => { const oldGlobal = this.layerState.globalFilters.data const key = "show-favourite" if(favouritesShown){