app: take into account possibility of NULL error.

Normally the error should not be NULL if file_open_layers() returns no
layers. But just in case, in order not to crash when we could avoid it,
let's double-check.
This commit is contained in:
Jehan 2026-01-09 17:30:40 +01:00
parent 85a9af435a
commit 76a255caa1

View file

@ -298,7 +298,7 @@ file_open_dialog_open_layers (GtkWidget *dialog,
{
gimp_message (image->gimp, G_OBJECT (dialog), GIMP_MESSAGE_ERROR,
_("Opening '%s' failed:\n\n%s"),
gimp_file_get_utf8_name (file), error->message);
gimp_file_get_utf8_name (file), error ? error->message: _("n/a"));
g_clear_error (&error);
}