stack: protect set_visible_child_name from NULL stack
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Thu, 19 Apr 2018 01:58:57 +0000 (20:58 -0500)
committerMarco Trevisan <mail@3v1n0.net>
Thu, 19 Apr 2018 08:40:17 +0000 (08:40 +0000)
Return with error if gtk_stack_set_visible_child_name is called
with NULL parameter

(cherry picked from commit 2ee5aee4a9f01cce3dda7dff877070b62c3e2880)

gtk/gtkstack.c

index b508aee6590ad892c892bb30171cf6cbec1d44c9..34f5491c4828258a44c925d70f9b45ab46d83555 100644 (file)
@@ -1670,6 +1670,8 @@ gtk_stack_set_visible_child_name (GtkStack   *stack,
 {
   GtkStackPrivate *priv = gtk_stack_get_instance_private (stack);
 
+  g_return_if_fail (GTK_IS_STACK (stack));
+
   gtk_stack_set_visible_child_full (stack, name, priv->transition_type);
 }