diff --git a/bec_widgets/utils/colors.py b/bec_widgets/utils/colors.py index 4a953943..9ccaaa64 100644 --- a/bec_widgets/utils/colors.py +++ b/bec_widgets/utils/colors.py @@ -12,7 +12,10 @@ from qtpy.QtWidgets import QApplication def get_theme_palette(): - theme = QApplication.instance().theme["theme"] + if QApplication.instance() is None or not hasattr(QApplication.instance(), "theme"): + theme = "dark" + else: + theme = QApplication.instance().theme["theme"] return bec_qthemes.load_palette(theme)