summaryrefslogtreecommitdiff
path: root/src/app.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-03-04 14:26:25 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-03-04 22:24:43 +0200
commitab968f72871f8974e895152ab8eb83e71db9214f (patch)
tree27191ccb7d7576e6958a1d762407e16792d64583 /src/app.c
parentb1b4b6458548e42656045cad9d0552e30b45678d (diff)
Possible crash when opening Preferences
Diffstat (limited to 'src/app.c')
-rw-r--r--src/app.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/app.c b/src/app.c
index 35a70f0b..25b068a5 100644
--- a/src/app.c
+++ b/src/app.c
@@ -1175,11 +1175,13 @@ static void updatePrefsThemeButtons_(iWidget *d) {
1175 1175
1176static void updateDropdownSelection_(iLabelWidget *dropButton, const char *selectedCommand) { 1176static 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}