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 2022-09-05 20:58:15 -03:00
parent 43c3a4b20d
commit abe12cca30

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