diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-11-22 18:55:07 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-11-22 19:04:57 +0300 |
commit | aadbb794cd6ee757c0b62c4735fec5ec696b02a9 (patch) | |
tree | 79636f2da2ffd97889e5fc2c44f8ca425883b417 /source | |
parent | b037ba2665f4b08d91e0d7d1b350c8bb562ca320 (diff) |
Fix T71741: Crash showing the object relations menu
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/object/object_modifier.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index abcb4afa37d..303e53fa5ee 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -923,6 +923,7 @@ bool edit_modifier_poll_generic(bContext *C, { PointerRNA ptr = CTX_data_pointer_get_type(C, "modifier", rna_type); Object *ob = (ptr.owner_id) ? (Object *)ptr.owner_id : ED_object_active_context(C); + ModifierData *mod = ptr.data; /* May be NULL. */ if (!ob || ID_IS_LINKED(ob)) { return 0; @@ -935,8 +936,10 @@ bool edit_modifier_poll_generic(bContext *C, } if (ID_IS_OVERRIDE_LIBRARY(ob)) { - CTX_wm_operator_poll_msg_set(C, "Cannot edit modifiers coming from library override"); - return (((ModifierData *)ptr.data)->flag & eModifierFlag_OverrideLibrary_Local) != 0; + if ((mod != NULL) && (mod->flag & eModifierFlag_OverrideLibrary_Local) == 0) { + CTX_wm_operator_poll_msg_set(C, "Cannot edit modifiers coming from library override"); + return 0; + } } if (!is_editmode_allowed && CTX_data_edit_object(C) != NULL) { |