app: initialize font to NULL.

In case there are no fonts loaded (which may happen in particular when starting
with --no-fonts), we need to make sure that font is initialized to NULL so that
we can return the standard GimpFont object and not a broken pointer.

Thanks to Idriss for the additional diagnosis, which would hopefully complete
commit 5dc86277e6 and take care of #11219.
This commit is contained in:
Jehan 2024-04-12 12:19:33 +02:00
parent 0df73ade6c
commit ef9de3c263
1 changed files with 1 additions and 1 deletions

View File

@ -237,7 +237,7 @@ gimp_font_deserialize_create (GType type,
gint nest_level,
gpointer data)
{
GimpFont *font;
GimpFont *font = NULL;
GimpContainer *fonts_container = GIMP_FONT_CLASS (g_type_class_peek (GIMP_TYPE_FONT))->fonts_container;
gint most_similar_font_index = -1;
gint font_count = gimp_container_get_n_children (fonts_container);