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()`).
This commit is contained in:
Sybren A. Stüvel 2019-09-17 17:08:51 +02:00
parent dc6cec65af
commit 8c0dea72b6
Notes: blender-bot 2023-02-14 00:48:29 +01:00
Referenced by issue #69886, Operator Search results instant crash with certain first characters
1 changed files with 4 additions and 0 deletions

View File

@ -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;