diff --git a/ovos_gui/namespace.py b/ovos_gui/namespace.py index b06cc10..0c4ca5e 100644 --- a/ovos_gui/namespace.py +++ b/ovos_gui/namespace.py @@ -778,6 +778,10 @@ def _load_pages(self, pages_to_show: List[GuiPage], show_index: int): @param pages_to_show: list of pages to be loaded @param show_index: index to load pages at """ + if not self.active_namespaces: + LOG.error("received 'load_pages' request but there are no active namespaces") + return + if not len(pages_to_show) or show_index >= len(pages_to_show): LOG.error(f"requested invalid page index: {show_index}, defaulting to last page") show_index = len(pages_to_show) - 1 @@ -1011,6 +1015,10 @@ def handle_namespace_global_back(self, message: Optional[Message]): Handles global back events from the GUI. @param message: the event sent by the GUI """ + if not self.active_namespaces: + LOG.error("received 'back' signal but there are no active namespaces") + return + namespace_name = self.active_namespaces[0].skill_id namespace = self.loaded_namespaces.get(namespace_name) if namespace in self.active_namespaces: