From 2c7ad39202242c83265dcd94e384b8ad12979d83 Mon Sep 17 00:00:00 2001 From: Lars Uebernickel Date: Mon, 4 Jun 2012 18:56:44 +0200 Subject: gactionmuxer: don't crash when no global actions are given --- src/gactionmuxer.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/gactionmuxer.c') 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)) -- cgit v1.2.3