Commit 616285fa authored by Michael Natterer's avatar Michael Natterer 😴

app: fix possible warning when removing layers, channels or vectors

Don't call gimp_viewable_is_ancestor() on a NULL ancestor.
parent 7a47e36c
......@@ -3695,9 +3695,10 @@ gimp_image_remove_layer (GimpImage *image,
*/
floating_sel_activate_drawable (layer);
}
else if (layer == active_layer ||
gimp_viewable_is_ancestor (GIMP_VIEWABLE (layer),
GIMP_VIEWABLE (active_layer)))
else if (active_layer &&
(layer == active_layer ||
gimp_viewable_is_ancestor (GIMP_VIEWABLE (layer),
GIMP_VIEWABLE (active_layer))))
{
gimp_image_set_active_layer (image, new_active);
}
......@@ -3869,9 +3870,10 @@ gimp_image_remove_channel (GimpImage *image,
GIMP_ITEM (channel),
GIMP_ITEM (new_active)));
if (channel == active_channel ||
gimp_viewable_is_ancestor (GIMP_VIEWABLE (channel),
GIMP_VIEWABLE (active_channel)))
if (active_channel &&
(channel == active_channel ||
gimp_viewable_is_ancestor (GIMP_VIEWABLE (channel),
GIMP_VIEWABLE (active_channel))))
{
if (new_active)
gimp_image_set_active_channel (image, new_active);
......@@ -3953,9 +3955,10 @@ gimp_image_remove_vectors (GimpImage *image,
GIMP_ITEM (vectors),
GIMP_ITEM (new_active)));
if (vectors == active_vectors ||
gimp_viewable_is_ancestor (GIMP_VIEWABLE (vectors),
GIMP_VIEWABLE (active_vectors)))
if (active_vectors &&
(vectors == active_vectors ||
gimp_viewable_is_ancestor (GIMP_VIEWABLE (vectors),
GIMP_VIEWABLE (active_vectors))))
{
gimp_image_set_active_vectors (image, new_active);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment