diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2020-06-22 21:06:28 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2020-06-22 21:06:43 +0300 |
commit | 73d3f51c16972d23b70d31c88786d7e3b37e7ff8 (patch) | |
tree | e38e4dd815b467feb1231df710d5566f1f1d7634 /source/blender/editors/gpencil/gpencil_convert.c | |
parent | 15dda0115c783805753119984decb4d9249b1f01 (diff) |
Fix T78136: Image editor - crash to desktop with changing the threshold for extract palette
Also fixed the same error in generate GPencil object from image.
The problem was the Render Result image hasn't ibuf.
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_convert.c')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_convert.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/editors/gpencil/gpencil_convert.c b/source/blender/editors/gpencil/gpencil_convert.c index f1b8ae61994..75249fbdd06 100644 --- a/source/blender/editors/gpencil/gpencil_convert.c +++ b/source/blender/editors/gpencil/gpencil_convert.c @@ -55,6 +55,7 @@ #include "BKE_global.h" #include "BKE_gpencil.h" #include "BKE_gpencil_geom.h" +#include "BKE_image.h" #include "BKE_layer.h" #include "BKE_main.h" #include "BKE_material.h" @@ -1773,7 +1774,10 @@ static bool image_to_gpencil_poll(bContext *C) { SpaceLink *sl = CTX_wm_space_data(C); if ((sl != NULL) && (sl->spacetype == SPACE_IMAGE)) { - return true; + SpaceImage *sima = CTX_wm_space_image(C); + Image *image = sima->image; + ImageUser iuser = sima->iuser; + return BKE_image_has_ibuf(image, &iuser); } return false; |