Mercurial > libervia-desktop-kivy
diff cagou/core/cagou_main.py @ 358:8efed1d47d9f
core: don't crash when a widget without profiles switch to default widget
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 18 Jan 2020 23:12:52 +0100 |
parents | 4d3a0c4f2430 |
children | a77386b73e55 |
line wrap: on
line diff
--- a/cagou/core/cagou_main.py Sat Jan 18 23:12:52 2020 +0100 +++ b/cagou/core/cagou_main.py Sat Jan 18 23:12:52 2020 +0100 @@ -750,7 +750,11 @@ old = self.getWidgetToSwitch() if new is None: factory = self.default_wid['factory'] - new = factory(self.default_wid, None, profiles=old.profiles) + try: + profiles = old.profiles + except AttributeError: + profiles = None + new = factory(self.default_wid, None, profiles=profiles) to_change = None if isinstance(old, CagouWidget): to_change = old