core: Fix crash when cutting/pasting single layer

When cutting and pasting a single layer,
drawables->data might be empty. This results in a
crash on Windows and a failure to paste on Linux.
Since this function is inside an IF statement that already
confirms it has a valid image, the base type and
precision are retrieved from there instead.
This commit is contained in:
Alx Sa 2023-12-24 13:07:52 +00:00 committed by cmyk.student
parent a331e91309
commit d120e592d8
1 changed files with 2 additions and 2 deletions

View File

@ -520,8 +520,8 @@ gimp_edit_paste_get_layers (GimpImage *image,
}
layers = gimp_edit_paste_get_tagged_layers (image, layers, NULL, floating_format,
gimp_drawable_get_base_type (drawables->data),
gimp_drawable_get_precision (drawables->data),
gimp_image_get_base_type (image),
gimp_image_get_precision (image),
*paste_type);
layers = g_list_reverse (layers);
}