[Bf-blender-cvs] [f9228816201] blender2.8: Fix T56666: Crash typing "w" in the search function.

Bastien Montagne noreply at git.blender.org
Mon Sep 3 16:07:05 CEST 2018


Commit: f92288162016ca7b256a940d0b78f33659ee387e
Author: Bastien Montagne
Date:   Mon Sep 3 16:05:57 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBf92288162016ca7b256a940d0b78f33659ee387e

Fix T56666: Crash typing "w" in the search function.

One shall check object is a GPencil one, before trying to use ob->data...

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

M	source/blender/editors/gpencil/gpencil_armature.c

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

diff --git a/source/blender/editors/gpencil/gpencil_armature.c b/source/blender/editors/gpencil/gpencil_armature.c
index 57e15250ed2..0bd6989be73 100644
--- a/source/blender/editors/gpencil/gpencil_armature.c
+++ b/source/blender/editors/gpencil/gpencil_armature.c
@@ -527,6 +527,11 @@ bool ED_gpencil_add_armature_weights(
 static bool gpencil_generate_weights_poll(bContext *C)
 {
 	Object *ob = CTX_data_active_object(C);
+
+	if (ob->type != OB_GPENCIL) {
+		return false;
+	}
+
 	ViewLayer *view_layer = CTX_data_view_layer(C);
 	bGPdata *gpd = (bGPdata *)ob->data;



More information about the Bf-blender-cvs mailing list