diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-04 14:26:25 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-04 22:24:43 +0200 |
commit | ab968f72871f8974e895152ab8eb83e71db9214f (patch) | |
tree | 27191ccb7d7576e6958a1d762407e16792d64583 /src/app.c | |
parent | b1b4b6458548e42656045cad9d0552e30b45678d (diff) |
Possible crash when opening Preferences
Diffstat (limited to 'src/app.c')
-rw-r--r-- | src/app.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -1175,11 +1175,13 @@ static void updatePrefsThemeButtons_(iWidget *d) { | |||
1175 | 1175 | ||
1176 | static void updateDropdownSelection_(iLabelWidget *dropButton, const char *selectedCommand) { | 1176 | static void updateDropdownSelection_(iLabelWidget *dropButton, const char *selectedCommand) { |
1177 | iForEach(ObjectList, i, children_Widget(findChild_Widget(as_Widget(dropButton), "menu"))) { | 1177 | iForEach(ObjectList, i, children_Widget(findChild_Widget(as_Widget(dropButton), "menu"))) { |
1178 | iLabelWidget *item = i.object; | 1178 | if (isInstance_Object(i.object, &Class_LabelWidget)) { |
1179 | const iBool isSelected = endsWith_String(command_LabelWidget(item), selectedCommand); | 1179 | iLabelWidget *item = i.object; |
1180 | setFlags_Widget(as_Widget(item), selected_WidgetFlag, isSelected); | 1180 | const iBool isSelected = endsWith_String(command_LabelWidget(item), selectedCommand); |
1181 | if (isSelected) { | 1181 | setFlags_Widget(as_Widget(item), selected_WidgetFlag, isSelected); |
1182 | updateText_LabelWidget(dropButton, text_LabelWidget(item)); | 1182 | if (isSelected) { |
1183 | updateText_LabelWidget(dropButton, text_LabelWidget(item)); | ||
1184 | } | ||
1183 | } | 1185 | } |
1184 | } | 1186 | } |
1185 | } | 1187 | } |