[Bf-blender-cvs] [ebee593] master: Fix bug reported by kopias on irc, crash when attempting to set canvas with a non-mesh object selected

Antony Riakiotakis noreply at git.blender.org
Tue Dec 9 14:36:54 CET 2014


Commit: ebee593f26c052b0cb914debe797cc8f31be06fe
Author: Antony Riakiotakis
Date:   Tue Dec 9 14:36:24 2014 +0100
Branches: master
https://developer.blender.org/rBebee593f26c052b0cb914debe797cc8f31be06fe

Fix bug reported by kopias on irc, crash when attempting to set canvas
with a non-mesh object selected

===================================================================

M	source/blender/makesrna/intern/rna_sculpt_paint.c

===================================================================

diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c
index 73b7e31..0463250 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)




More information about the Bf-blender-cvs mailing list