Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@blender.org>2019-09-17 18:08:51 +0300
committerSybren A. Stüvel <sybren@blender.org>2019-09-18 11:23:42 +0300
commit8c0dea72b6791a07100487de556ab352106f7f44 (patch)
tree07f737b97f9927f35373c8af1acef82b91fabc9d
parentdc6cec65aff520783432bb9d177a0d87322396b3 (diff)
Fix segfault when polling OBJECT_OT_voxel_remesh without active object
The active object can be `NULL`, which causes a segfault in `BKE_object_is_in_editmode(NULL)` (and if that were made NULL-safe, the segfault would happen further down in `object_remesh_poll()`).
-rw-r--r--source/blender/editors/object/object_remesh.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/editors/object/object_remesh.c b/source/blender/editors/object/object_remesh.c
index 815cc618d4b..393f63d2177 100644
--- a/source/blender/editors/object/object_remesh.c
+++ b/source/blender/editors/object/object_remesh.c
@@ -73,6 +73,10 @@ static bool object_remesh_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
+ if (ob == NULL) {
+ return false;
+ }
+
if (BKE_object_is_in_editmode(ob)) {
CTX_wm_operator_poll_msg_set(C, "The voxel remesher cannot run from edit mode.");
return false;