inspector: Handle a11y being disabled
authorBenjamin Otte <otte@redhat.com>
Sat, 17 Jun 2023 20:02:38 +0000 (22:02 +0200)
committerBenjamin Otte <otte@redhat.com>
Sun, 18 Jun 2023 12:26:18 +0000 (14:26 +0200)
gtk/inspector/a11y.c

index 98c496fba1caf74278b743932c167dc7e474b137..3cb14ffc6a92c149c54f596c8e9701d2dbead7c8 100644 (file)
@@ -238,6 +238,8 @@ update_name (GtkInspectorA11y *sl)
   char *name;
 
   context = gtk_accessible_get_at_context (GTK_ACCESSIBLE (sl->object));
+  if (context == NULL)
+    return;
 
   name = gtk_at_context_get_name (context);
   gtk_label_set_label (GTK_LABEL (sl->name), name);
@@ -250,6 +252,8 @@ update_description (GtkInspectorA11y *sl)
   char *description;
 
   context = gtk_accessible_get_at_context (GTK_ACCESSIBLE (sl->object));
+  if (context == NULL)
+    return;
 
   description = gtk_at_context_get_description (context);
   gtk_label_set_label (GTK_LABEL (sl->description), description);