From 8c0dea72b6791a07100487de556ab352106f7f44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 17 Sep 2019 17:08:51 +0200 Subject: 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()`). --- source/blender/editors/object/object_remesh.c | 4 ++++ 1 file changed, 4 insertions(+) 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; -- cgit v1.2.3