PsppireSelector: Don't try to set callbacks on null model
authorJohn Darrington <john@darrington.wattle.id.au>
Sat, 28 Apr 2012 14:09:02 +0000 (16:09 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Sat, 28 Apr 2012 14:09:02 +0000 (16:09 +0200)
src/ui/gui/psppire-selector.c

index 08f7f0215d8fb505d1a4c8889949e22f3589f0b1..36cae5c18afe9aed88b4743f9bbdba9c31758fcf 100644 (file)
@@ -854,11 +854,14 @@ on_dest_model_changed (PsppireSelector *selector)
 {
   GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (selector->dest));
 
-  g_signal_connect (model, "row-changed", G_CALLBACK (on_dest_data_change),
-                   selector);
-
-  g_signal_connect (model, "row-deleted", G_CALLBACK (on_dest_data_delete),
-                   selector);
+  if ( model ) 
+    {
+      g_signal_connect (model, "row-changed", G_CALLBACK (on_dest_data_change),
+                       selector);
+      
+      g_signal_connect (model, "row-deleted", G_CALLBACK (on_dest_data_delete),
+                       selector);
+    }
 }
 
 /* Set the destination widget to DEST */