diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2022-04-05 10:49:55 +0300 |
---|---|---|
committer | Fabian Schempp <fabianschempp@googlemail.com> | 2022-04-11 01:31:59 +0300 |
commit | 6e8b61022300f71fcc20db28620f723a71186ceb (patch) | |
tree | 17b7ce4250309e23f769fcfecae74688c99e1136 /source | |
parent | c262c26fa5434dc1268844532a5fc7bbba3ba788 (diff) |
Fix T96888: data transfer operator crash in certain situation
The operator could crash in case the context "object" was overridden
from python, but the "active_object" wasnt (and the active object was
not a mesh).
Reason for the crash is a mismatch in the operators poll function
`data_transfer_poll` vs. `dt_layers_select_src_itemf` -- in the former,
the overriden "object" was respected (and if this was a mesh, the poll
was permissive), in the later it wasnt and only the "active_object" was
used (if this was not a mesh, a crash would happen trying to get an
evaluated mesh).
Now rectify how the object which is used is being fetched -> use
`ED_object_active_context` everywhere (see also rBe560bbe1d584).
Maniphest Tasks: T96888
Differential Revision: https://developer.blender.org/D14552
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/object/object_data_transfer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/editors/object/object_data_transfer.c b/source/blender/editors/object/object_data_transfer.c index 3447ded5f68..23d2327fe72 100644 --- a/source/blender/editors/object/object_data_transfer.c +++ b/source/blender/editors/object/object_data_transfer.c @@ -137,7 +137,7 @@ static const EnumPropertyItem *dt_layers_select_src_itemf(bContext *C, RNA_enum_items_add_value( &item, &totitem, rna_enum_dt_layers_select_src_items, DT_LAYERS_ALL_SRC); - Object *ob_src = CTX_data_active_object(C); + Object *ob_src = ED_object_active_context(C); if (ob_src == NULL) { RNA_enum_item_end(&item, &totitem); *r_free = true; |