inspector: be defensive against out parameters
authorChristian Hergert <chergert@redhat.com>
Fri, 3 Mar 2023 20:17:07 +0000 (12:17 -0800)
committerChristian Hergert <chergert@redhat.com>
Fri, 3 Mar 2023 20:17:32 +0000 (12:17 -0800)
Set initial state to NULL so that we don't risk accessing an unset out
parameter.

Fixes a crash when activating certain actions.

gtk/inspector/action-editor.c

index 052ef237b09f94a35cbb15de3f74d4cbc3130d8a..616a592096f4f0b5cc96ba48adb43888c178445d 100644 (file)
@@ -185,7 +185,7 @@ action_state_changed_cb (GActionGroup             *group,
 static void
 update_widgets (GtkInspectorActionEditor *r)
 {
-  GVariant *state;
+  GVariant *state = NULL;
 
   if (G_IS_ACTION_GROUP (r->owner))
     g_action_group_query_action (G_ACTION_GROUP (r->owner), r->name,