comparison sat_frontends/quick_frontend/quick_widgets.py @ 2888:e3803ae89fbc

quick_frontend (widgets): fixed crash on getWidgets when target doesn't correspond to any widget
author Goffi <goffi@goffi.org>
date Sun, 07 Apr 2019 15:04:28 +0200
parents ef65dbce313b
children ab2696e34d29
comparison
equal deleted inserted replaced
2887:9aadf11b315b 2888:e3803ae89fbc
116 if target is not None: 116 if target is not None:
117 filter_hash = unicode(class_.getWidgetHash(target, profiles)) 117 filter_hash = unicode(class_.getWidgetHash(target, profiles))
118 else: 118 else:
119 filter_hash = None 119 filter_hash = None
120 if filter_hash is not None: 120 if filter_hash is not None:
121 for widget in widgets_map[filter_hash]: 121 for widget in widgets_map.get(filter_hash, []):
122 yield widget 122 yield widget
123 else: 123 else:
124 for widget_instances in widgets_map.itervalues(): 124 for widget_instances in widgets_map.itervalues():
125 for widget in widget_instances: 125 for widget in widget_instances:
126 yield widget 126 yield widget