include format.h only where necessary.
[pspp-builds.git] / src / ui / gui / variable-info-dialog.c
index d00fcd5d55d15c37b3a292141e7ae8ec3f4eb706..533021e762cb45f73e1a996444cde856e725689a 100644 (file)
 #include <config.h>
 #include <gtk/gtk.h>
 #include <glade/glade.h>
-#include <gtksheet/gtksheet.h>
 
 #include "dict-display.h"
 #include "var-display.h"
 #include <data/variable.h>
+#include <data/format.h>
 #include <data/value-labels.h>
 #include "data-editor.h"
 #include "psppire-dialog.h"
 #include "psppire-var-store.h"
 #include "helper.h"
-#include <gtksheet/gtksheet.h>
 
 #include <language/syntax-string-source.h>
 #include "syntax-editor.h"
@@ -76,6 +75,8 @@ populate_text (GtkTreeView *treeview, gpointer data)
 
   GtkTextBuffer *textbuffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW(data));
   const struct variable *var = get_selected_variable (treeview);
+  if ( var == NULL)
+    return;
 
   gstring = g_string_sized_new (200);
   text = name_to_string (var, NULL);