Check for NULL groups in gtk_action_muxer_get_group ()

The groups hash table is initialized lazily when inserting
the first GActionGroup (gtk_action_muxer_insert ()). Do as
all surrounding code does and check for NULL before using
groups.

This avoids triggering a warning
This commit is contained in:
Luca Bacci 2023-05-17 14:00:56 +02:00 committed by Matthias Clasen
parent ba69a30d27
commit a55b84f524

View File

@ -325,6 +325,9 @@ gtk_action_muxer_get_group (GtkActionMuxer *muxer,
{
Group *group;
if (!muxer->groups)
return NULL;
group = g_hash_table_lookup (muxer->groups, group_name);
if (group)
return group->group;