From 1485e3a189c42b1ac1339c063c85d9e74e503431 Mon Sep 17 00:00:00 2001
From: John Darrington <john@darrington.wattle.id.au>
Date: Tue, 7 Jul 2009 01:38:21 +0800
Subject: [PATCH] Fix crash when opening empty dataset

---
 src/ui/gui/psppire-data-store.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/ui/gui/psppire-data-store.c b/src/ui/gui/psppire-data-store.c
index 0779512433..65001dd170 100644
--- a/src/ui/gui/psppire-data-store.c
+++ b/src/ui/gui/psppire-data-store.c
@@ -801,6 +801,9 @@ get_column_button_label (const PsppireSheetModel *model, gint col)
 
   pv = psppire_dict_get_variable (ds->dict, col);
 
+  if (NULL == pv)
+    return NULL;
+
   return xstrdup (var_get_name (pv));
 }
 
-- 
2.30.2