summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2013-07-23 20:18:54 -0400
committerMatthias Clasen <mclasen@redhat.com>2013-07-24 07:31:05 -0400
commit4af588e477fd2462e677543a8680a9d5590ebc40 (patch)
treed754d39306f8371dcb8e7fdb77ad514f6264a75c /examples
parent7fe3455c9a45b438b947eb0c15c6b8dceb26bc63 (diff)
downloadgtk+-4af588e477fd2462e677543a8680a9d5590ebc40.tar.gz
Getting started: Fix a corner case
When using 'Words' without a loaded document, the example would crash. Thats not nice, so avoid it.
Diffstat (limited to 'examples')
-rw-r--r--examples/application8/exampleappwin.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/examples/application8/exampleappwin.c b/examples/application8/exampleappwin.c
index d3f1cc5f8c..ea826166c6 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));