Fixed bug GRAPH /HISTOGRAM vs. null data.
[pspp] / src / language / stats / graph.c
index ae80616862f7aeda14e42e49a1b78609ccb860f4..b695f4c94a4f671fc7325304891e7c69e7dd227e 100644 (file)
@@ -189,6 +189,11 @@ show_histogr (const struct graph *cmd, struct casereader *input)
       histogram_create (bin_width, cmd->es[0].minimum, cmd->es[0].maximum);
   }
 
+  if (NULL == histogram)
+    {
+      casereader_destroy (input);
+      return;
+    }
 
   for (;(c = casereader_read (input)) != NULL; case_unref (c))
     {