[gtk+] snapshot: Handle NULL returns in pop_and_append()



commit 6b29dbf26a28497048857938b5bc4bcb033b859b
Author: Benjamin Otte <otte redhat com>
Date:   Sat Dec 17 08:03:43 2016 +0100

    snapshot: Handle NULL returns in pop_and_append()

 gtk/gtksnapshot.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtksnapshot.c b/gtk/gtksnapshot.c
index 4f05586..dfcd3f3 100644
--- a/gtk/gtksnapshot.c
+++ b/gtk/gtksnapshot.c
@@ -473,8 +473,11 @@ gtk_snapshot_pop_and_append (GtkSnapshot *snapshot)
   GskRenderNode *node;
 
   node = gtk_snapshot_pop (snapshot);
-  gtk_snapshot_append_node (snapshot, node);
-  gsk_render_node_unref (node);
+  if (node)
+    {
+      gtk_snapshot_append_node (snapshot, node);
+      gsk_render_node_unref (node);
+    }
 }
 
 /**


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