app: Partial fix for #13702 infinite loop on startup

If somehow an image is not passed when opened from the command line, this avoids an infinite loop
as was seen in #13702

This still does not solve the issue of how a bad image was passed in in the first place.
This commit is contained in:
Lukas Oberhuber 2025-04-20 15:51:49 +01:00
parent 994cb2b21f
commit d46b6e4e0e

View file

@ -749,6 +749,11 @@ static void
file_open_sanitize_image (GimpImage *image, file_open_sanitize_image (GimpImage *image,
gboolean as_new) gboolean as_new)
{ {
/* This should never occur, but apparently it does sometimes #13702
* Avoids infinite loop in the while statement below.
*/
g_return_if_fail (GIMP_IS_IMAGE (image));
if (as_new) if (as_new)
gimp_image_set_file (image, NULL); gimp_image_set_file (image, NULL);