diff options
author | Lars Uebernickel <lars.uebernickel@canonical.com> | 2012-06-04 18:56:44 +0200 |
---|---|---|
committer | Lars Uebernickel <lars.uebernickel@canonical.com> | 2012-06-04 18:56:44 +0200 |
commit | 2c7ad39202242c83265dcd94e384b8ad12979d83 (patch) | |
tree | 6913c8226d99121fa1c4915615d4b61058d61969 /src | |
parent | fab2ebfc84ded877f392369d8643634b0e5446f8 (diff) | |
download | ayatana-indicator-messages-2c7ad39202242c83265dcd94e384b8ad12979d83.tar.gz ayatana-indicator-messages-2c7ad39202242c83265dcd94e384b8ad12979d83.tar.bz2 ayatana-indicator-messages-2c7ad39202242c83265dcd94e384b8ad12979d83.zip |
gactionmuxer: don't crash when no global actions are given
Diffstat (limited to 'src')
-rw-r--r-- | src/gactionmuxer.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/gactionmuxer.c b/src/gactionmuxer.c index 6c4d08b..ac3f8e4 100644 --- a/src/gactionmuxer.c +++ b/src/gactionmuxer.c @@ -227,13 +227,16 @@ g_action_muxer_list_actions (GActionGroup *group) all_actions = g_array_sized_new (TRUE, FALSE, sizeof (gchar *), 8); - actions = g_action_group_list_actions (muxer->global_actions); - for (a = actions; *a; a++) + if (muxer->global_actions) { - gchar *name = g_strdup (*a); - g_array_append_val (all_actions, name); + actions = g_action_group_list_actions (muxer->global_actions); + for (a = actions; *a; a++) + { + gchar *name = g_strdup (*a); + g_array_append_val (all_actions, name); + } + g_strfreev (actions); } - g_strfreev (actions); g_hash_table_iter_init (&it, muxer->groups); while (g_hash_table_iter_next (&it, (gpointer *) &prefix, (gpointer *) &subgroup)) |