summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Newman <MikeGTN@src.gnome.org>2003-01-17 07:46:11 +0000
committerMike Newman <MikeGTN@src.gnome.org>2003-01-17 07:46:11 +0000
commit0e338ba3e0fa03b28664448af0cea686c5e6c26d (patch)
tree83a76542a48cdd18d00d0327310be7b1229d6882
parent4115d4e1f57c572b4efa1d6d9c9fc8541284f1db (diff)
Fix a segfault in the --list if no data is supplied to populate
the tree.
-rw-r--r--ChangeLog6
-rw-r--r--src/tree.c8
2 files changed, 13 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 0aee393..cc2a008 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2003-01-16 Mike Newman <mike@gtnorthern.demon.co.uk>
+
+ * src/tree.c: fix a segfault if a --list is constructed and there
+ is no data to put in it. Since a list with no contents to select
+ seemed pointless, return without showing dialog.
+
2003-01-15 Glynn Foster <glynn.foster@sun.com>
* help/C/Makefile.am, help/C/legal.xml, help/C/zenity-C.omf,
diff --git a/src/tree.c b/src/tree.c
index 29b38c6..c19b180 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -124,7 +124,13 @@ zenity_tree (ZenityData *data, ZenityTreeData *tree_data)
data->exit_code = -1;
return;
}
-
+
+ if (tree_data->data == NULL) {
+ g_printerr (_("No contents specified for --list\n"));
+ data->exit_code = -1;
+ return;
+ }
+
glade_xml_signal_autoconnect (glade_dialog);
dialog = glade_xml_get_widget (glade_dialog, "zenity_tree_dialog");