PsppireSelector: Don't attempt to unref a null pointer
authorJohn Darrington <john@darrington.wattle.id.au>
Sun, 9 Aug 2020 16:16:27 +0000 (18:16 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Sun, 16 Aug 2020 07:14:40 +0000 (09:14 +0200)
src/ui/gui/psppire-selector.c

index a021d92190eba329705f1fca38713351d46c7c98..fbc88f1aa8f41fc21f064c809da5d0ffe20d4ecc 100644 (file)
@@ -188,8 +188,11 @@ psppire_selector_dispose (GObject *obj)
       sel->source_litem = NULL;
     }
 
       sel->source_litem = NULL;
     }
 
-  g_object_unref (sel->dest);
-  g_object_unref (sel->source);
+  if (sel->dest)
+    g_object_unref (sel->dest);
+
+  if (sel->source)
+    g_object_unref (sel->source);
 
   /* Chain up to the parent class */
   G_OBJECT_CLASS (parent_class)->dispose (obj);
 
   /* Chain up to the parent class */
   G_OBJECT_CLASS (parent_class)->dispose (obj);