From 33b19a291abe779423fe1224245e744336c6b058 Mon Sep 17 00:00:00 2001
From: Matthias Clasen <mclasen@redhat.com>
Date: Fri, 17 Jul 2015 15:51:05 -0400
Subject: [PATCH 1/7] gtk-demo: Check a return value
Found by coverity.
---
demos/gtk-demo/main.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/demos/gtk-demo/main.c b/demos/gtk-demo/main.c
index 167c729..9fedfef 100644
--- a/demos/gtk-demo/main.c
+++ b/demos/gtk-demo/main.c
@@ -158,9 +158,8 @@ activate_run (GSimpleAction *action,
GtkTreeIter iter;
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview));
- gtk_tree_selection_get_selected (selection, &model, &iter);
-
- run_example_for_row (window, model, &iter);
+ if (gtk_tree_selection_get_selected (selection, &model, &iter))
+ run_example_for_row (window, model, &iter);
}
/* Stupid syntax highlighting.
--
2.4.5