diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2014-12-09 16:36:24 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2014-12-09 16:36:24 +0300 |
commit | ebee593f26c052b0cb914debe797cc8f31be06fe (patch) | |
tree | 3b32b669bb51a60d18e01656e0c432119d5c5273 /source/blender/makesrna/intern | |
parent | 59f1585d020c2df7f11f89660f0d2d6ce87c5289 (diff) |
Fix bug reported by kopias on irc, crash when attempting to set canvas
with a non-mesh object selected
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_sculpt_paint.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index 73b7e310d1d..0463250d1bb 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -343,9 +343,11 @@ static void rna_ImaPaint_canvas_update(Main *bmain, Scene *scene, PointerRNA *UN } } - GPU_drawobject_free(ob->derivedFinal); - BKE_paint_proj_mesh_data_check(scene, ob, NULL, NULL, NULL, NULL); - WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL); + if (ob && ob->type == OB_MESH) { + GPU_drawobject_free(ob->derivedFinal); + BKE_paint_proj_mesh_data_check(scene, ob, NULL, NULL, NULL, NULL); + WM_main_add_notifier(NC_OBJECT | ND_DRAW, NULL); + } } static int rna_ImaPaint_detect_data(ImagePaintSettings *imapaint) |