[gtk+/gtk-3-16] gtk-demo: Check a return value



commit 7566066000d1640fddca8cad65967cafeb6c80dc
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Jul 17 15:51:05 2015 -0400

    gtk-demo: Check a return value
    
    Found by coverity.

 demos/gtk-demo/main.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/demos/gtk-demo/main.c b/demos/gtk-demo/main.c
index b8131b9..ee87fc9 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.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]