checkbutton: fix critical when setting use-underline

This needs to make sure that we've created the label before applying the
setting on a child widget.

Fixes #4934
This commit is contained in:
Christian Hergert 2022-05-17 12:28:25 -07:00
parent 5f469a0d2d
commit b9574e119b

View File

@ -1099,7 +1099,7 @@ gtk_check_button_set_use_underline (GtkCheckButton *self,
return;
priv->use_underline = setting;
if (priv->child_type == LABEL_CHILD)
if (priv->child_type == LABEL_CHILD && priv->child != NULL)
gtk_label_set_use_underline (GTK_LABEL (priv->child), priv->use_underline);
g_object_notify_by_pspec (G_OBJECT (self), props[PROP_USE_UNDERLINE]);