diff options
author | Colomban Wendling <[email protected]> | 2023-11-15 15:31:27 +0100 |
---|---|---|
committer | raveit65 <[email protected]> | 2024-02-04 18:37:58 +0100 |
commit | d437f5bba6a55ef585a2d51beadf68d71f7f7221 (patch) | |
tree | cee8a33f187d8dc849cfb48a9c569aa05d4037c8 | |
parent | 62fabfc793b545250dafaf37f75650cbfdce095f (diff) | |
download | mate-panel-d437f5bba6a55ef585a2d51beadf68d71f7f7221.tar.bz2 mate-panel-d437f5bba6a55ef585a2d51beadf68d71f7f7221.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.
-rw-r--r-- | mate-panel/panel-profile.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/mate-panel/panel-profile.c b/mate-panel/panel-profile.c index 06d096c2..b637563a 100644 --- a/mate-panel/panel-profile.c +++ b/mate-panel/panel-profile.c @@ -1593,12 +1593,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 |