From 1685c86af5d6253151d0056a9677ba469ea10164 Mon Sep 17 00:00:00 2001 From: Alx Sa Date: Mon, 19 May 2025 19:34:47 +0000 Subject: [PATCH] widgets: Don't show palette name with no palette Resolves #14047 The Color Dialog that appears when you select a text outline color does not load a palette from context. Since we then try to get the name from a NULL palette, this causes a crash. This patch resolves the issue by adding a check for the palette's existence before trying to get its name. --- app/widgets/gimpcolorselectorpalette.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/widgets/gimpcolorselectorpalette.c b/app/widgets/gimpcolorselectorpalette.c index ef3b7adc59..98c58d326e 100644 --- a/app/widgets/gimpcolorselectorpalette.c +++ b/app/widgets/gimpcolorselectorpalette.c @@ -100,13 +100,16 @@ gimp_color_selector_palette_palette_changed (GimpContext *context, GimpPalette *palette, GimpColorSelectorPalette *select) { - gchar *palette_name; - gimp_view_set_viewable (GIMP_VIEW (select->view), GIMP_VIEWABLE (palette)); - g_object_get (palette, "name", &palette_name, NULL); - gtk_label_set_text (GTK_LABEL (select->name_label), palette_name); - g_free (palette_name); + if (palette != NULL) + { + gchar *palette_name; + + g_object_get (palette, "name", &palette_name, NULL); + gtk_label_set_text (GTK_LABEL (select->name_label), palette_name); + g_free (palette_name); + } } static void