summaryrefslogtreecommitdiff
path: root/mate-panel
diff options
context:
space:
mode:
authorColomban Wendling <[email protected]>2023-11-15 15:31:27 +0100
committerLuke from DC <[email protected]>2023-11-21 20:19:58 +0000
commit17b87e321bfca409c31ce4b4e0e3326eeef92b88 (patch)
tree0c20e9663afb8b77799ae34698ac943c40cda106 /mate-panel
parent1b15e2f5f6d33bd8139636a3c6f72fd07d3e5d7b (diff)
downloadmate-panel-17b87e321bfca409c31ce4b4e0e3326eeef92b88.tar.bz2
mate-panel-17b87e321bfca409c31ce4b4e0e3326eeef92b88.tar.xz
Avoid a redundant NULL check
It's probably not necessary to perform the NULL check at all as the only code paths that could make `list` NULL are already pretty dramatically broken, but as we have a NULL check move everything relevant inside it.
Diffstat (limited to 'mate-panel')
-rw-r--r--mate-panel/panel-profile.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/mate-panel/panel-profile.c b/mate-panel/panel-profile.c
index e2b6841d..437eb0e3 100644
--- a/mate-panel/panel-profile.c
+++ b/mate-panel/panel-profile.c
@@ -1628,12 +1628,13 @@ panel_profile_load_list (GSettings *settings,
list = g_settings_get_strv (settings, key);
- for (gint i = 0; list[i]; i++) {
- load_handler (list[i]);
- }
+ if (list) {
+ for (gint i = 0; list[i]; i++) {
+ load_handler (list[i]);
+ }
- if (list)
g_strfreev (list);
+ }
}
static void