diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2022-04-01 18:34:30 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2022-04-08 23:51:26 +0200 |
commit | 540b7bf7896274109d4f589c07fd78c051bd267b (patch) | |
tree | 717213ce476285cd63692c73655f8bd92c8dc555 | |
parent | 5b0a474a34c40a40af92840a40a71eb4cafa387d (diff) | |
download | libayatana-appindicator-540b7bf7896274109d4f589c07fd78c051bd267b.tar.gz libayatana-appindicator-540b7bf7896274109d4f589c07fd78c051bd267b.tar.bz2 libayatana-appindicator-540b7bf7896274109d4f589c07fd78c051bd267b.zip |
src/appindicator.c: Fix path NULL check in status_icon_change().
Inspired by n_elements.patch by Ash Holland. Thanks.
See https://bugs.launchpad.net/ubuntu/+source/libappindicator/+bug/1867996/comments/7
-rw-r--r-- | src/app-indicator.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/app-indicator.c b/src/app-indicator.c index cb0086f..3dc5937 100644 --- a/src/app-indicator.c +++ b/src/app-indicator.c @@ -1619,16 +1619,18 @@ status_icon_changes (AppIndicator * self, gpointer data) gint n_elements, i; gboolean found=FALSE; gtk_icon_theme_get_search_path(icon_theme, &path, &n_elements); - for (i=0; i< n_elements || path[i] == NULL; i++) { - if(g_strcmp0(path[i], theme_path) == 0) { - found=TRUE; - break; + if (path != NULL) { + for (i=0; i< n_elements; i++) { + if(g_strcmp0(path[i], theme_path) == 0) { + found=TRUE; + break; + } } + g_strfreev (path); } if(!found) { gtk_icon_theme_append_search_path(icon_theme, theme_path); } - g_strfreev (path); } const gchar * icon_name = NULL; |