printer: fix issue that could cause the panels to not show up on startup if moonraker is not connected

This commit is contained in:
alfrix committed 2022-09-05 21:02:04 -03:00
1 parent 43c3a4b20d
commit abe12cca30
1 file changed
+3 -1
+3 -1
View File
@@ -199,7 +199,9 @@ class Printer:
logging.debug(f"Power devices: {self.power_devices}")
def get_config_section_list(self, search=""):
return [i for i in list(self.config) if i.startswith(search)] if hasattr(self, "config") else []
if self.config is not None:
return [i for i in list(self.config) if i.startswith(search)] if hasattr(self, "config") else []
return []
def get_config_section(self, section):
return self.config[section] if section in self.config else False