From 5ece9b89905cfa65023f00b8e185fbf438c076f8 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Sun, 14 Apr 2019 16:06:39 +0200 Subject: settings: Avoid crashing on broken values If, for some reason, the xfconf database is broken and the actual button layout is not available, xfwm4-settings would crash. Check the settings value to avoid the crash. --- settings-dialogs/xfwm4-settings.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'settings-dialogs') diff --git a/settings-dialogs/xfwm4-settings.c b/settings-dialogs/xfwm4-settings.c index 046bc8626..0377a8b94 100644 --- a/settings-dialogs/xfwm4-settings.c +++ b/settings-dialogs/xfwm4-settings.c @@ -1404,7 +1404,7 @@ xfwm_settings_button_layout_property_changed (XfconfChannel *channel, gtk_container_get_children (GTK_CONTAINER (hidden_box))); /* Move buttons to the active list */ - for (str_value = g_value_get_string (value); *str_value != '\0'; ++str_value) + for (str_value = g_value_get_string (value); str_value != NULL && *str_value != '\0'; ++str_value) for (iter = children; iter != NULL; iter = g_list_next (iter)) { button = GTK_WIDGET (iter->data); -- cgit v1.2.1