widgets: Prevent CRITICAL introduced in b7e9634d

When used outside of the dockable dialogues,
GimpEditor objects might not have a label
widget assigned. This patch adds a check
to make sure it does before trying to
change its text.
This commit is contained in:
Alx Sa 2025-03-04 00:21:02 +00:00
parent 4012f93e62
commit d2889d5a00

View file

@ -816,8 +816,9 @@ gimp_editor_set_name (GimpEditor *editor,
{
g_return_if_fail (GIMP_IS_EDITOR (editor));
gtk_label_set_text (GTK_LABEL (editor->priv->name_label),
name ? name : _("(None)"));
if (editor->priv->name_label && GTK_IS_LABEL (editor->priv->name_label))
gtk_label_set_text (GTK_LABEL (editor->priv->name_label),
name ? name : _("(None)"));
}
void