[gimp/gimp-2-10] app: fix a critical on a colormap editor callback.



commit d378f193903f8cd82fa7b17f2c5535c8ddd59d79
Author: Jehan <jehan girinstud io>
Date:   Fri Mar 8 16:04:20 2019 +0100

    app: fix a critical on a colormap editor callback.
    
    On color update, check the existence of a context image before trying to
    update the colormap.

 app/widgets/gimpcolormapeditor.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/app/widgets/gimpcolormapeditor.c b/app/widgets/gimpcolormapeditor.c
index 2c622acb36..0b27511582 100644
--- a/app/widgets/gimpcolormapeditor.c
+++ b/app/widgets/gimpcolormapeditor.c
@@ -772,8 +772,12 @@ gimp_colormap_editor_edit_color_update (GimpColorDialog      *dialog,
 {
   GimpImage *image = GIMP_IMAGE_EDITOR (editor)->image;
 
-  gimp_image_set_colormap_entry (image, editor->col_index, color, TRUE);
-  gimp_image_flush (image);
+  if (image)
+    {
+      gimp_image_set_colormap_entry (image, editor->col_index, color, TRUE);
+      gimp_image_flush (image);
+    }
+
   switch (state)
     {
     case GIMP_COLOR_DIALOG_OK:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]