[gimp] app: fix a critical on a colormap editor callback.



commit 21d131636a1d7167508c02ffed0a05e03c12f7ff
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.
    
    (cherry picked from commit d378f193903f8cd82fa7b17f2c5535c8ddd59d79)

 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 a89f1399d3..059ada2047 100644
--- a/app/widgets/gimpcolormapeditor.c
+++ b/app/widgets/gimpcolormapeditor.c
@@ -764,8 +764,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]