Commit: 73ce35d33258eb43965c58f9aeafa985faa88435
Author: Sybren A. Stüvel
Date:   Tue Nov 26 12:12:29 2019 +0100
Branches: blender-v2.81-release
https://developer.blender.org/rB73ce35d33258eb43965c58f9aeafa985faa88435

Fix segfault when polling `MESH_OT_paint_mask_extract`

`CTX_data_active_object(C)` returns `NULL` when there is no active object,
and this was not tested for in the code.

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

M       source/blender/editors/mesh/editmesh_mask_extract.c

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

diff --git a/source/blender/editors/mesh/editmesh_mask_extract.c 
b/source/blender/editors/mesh/editmesh_mask_extract.c
index 25d3118b3a9..1f6211cb10b 100644
--- a/source/blender/editors/mesh/editmesh_mask_extract.c
+++ b/source/blender/editors/mesh/editmesh_mask_extract.c
@@ -59,7 +59,7 @@
 static bool paint_mask_extract_poll(bContext *C)
 {
   Object *ob = CTX_data_active_object(C);
-  if (ob->mode == OB_MODE_SCULPT) {
+  if (ob != NULL && ob->mode == OB_MODE_SCULPT) {
     if (ob->sculpt->bm) {
       CTX_wm_operator_poll_msg_set(C, "The mask can not be extracted with 
dyntopo activated.");
       return false;

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to