[gtk+] Getting started: Fix a corner case



commit 4af588e477fd2462e677543a8680a9d5590ebc40
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Jul 23 20:18:54 2013 -0400

    Getting started: Fix a corner case
    
    When using 'Words' without a loaded document, the example
    would crash. Thats not nice, so avoid it.

 examples/application8/exampleappwin.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/examples/application8/exampleappwin.c b/examples/application8/exampleappwin.c
index d3f1cc5..ea82616 100644
--- a/examples/application8/exampleappwin.c
+++ b/examples/application8/exampleappwin.c
@@ -89,6 +89,10 @@ update_words (ExampleAppWindow *win)
   priv = example_app_window_get_instance_private (win);
 
   tab = gtk_stack_get_visible_child (GTK_STACK (priv->stack));
+
+  if (tab == NULL)
+    return;
+
   view = gtk_bin_get_child (GTK_BIN (tab));
   buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
 


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