diff options
4 files changed, 18 insertions, 1 deletions
diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index 244124a6e0a..8ed1b862521 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -706,6 +706,11 @@ static bool edit_constraint_poll_generic(bContext *C, return false; } + if (!con) { + CTX_wm_operator_poll_msg_set(C, "Context missing active constraint"); + return false; + } + if (!is_liboverride_allowed && BKE_constraint_is_nonlocal_in_liboverride(ob, con)) { CTX_wm_operator_poll_msg_set( C, "Cannot edit constraints coming from linked data in a library override"); diff --git a/source/blender/editors/object/object_gpencil_modifier.c b/source/blender/editors/object/object_gpencil_modifier.c index 3995728c428..6d1c4481883 100644 --- a/source/blender/editors/object/object_gpencil_modifier.c +++ b/source/blender/editors/object/object_gpencil_modifier.c @@ -443,6 +443,10 @@ static bool gpencil_edit_modifier_poll_generic(bContext *C, return false; } + if (!mod) { + return false; + } + if (!is_liboverride_allowed && BKE_gpencil_modifier_is_nonlocal_in_liboverride(ob, mod)) { CTX_wm_operator_poll_msg_set( C, "Cannot edit modifiers coming from linked data in a library override"); diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 0d896f14888..38d027b3676 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -1051,6 +1051,10 @@ bool edit_modifier_poll_generic(bContext *C, return false; } + if (!mod) { + return false; + } + if (!is_liboverride_allowed && BKE_modifier_is_nonlocal_in_liboverride(ob, mod)) { CTX_wm_operator_poll_msg_set( C, "Cannot edit modifiers coming from linked data in a library override"); diff --git a/source/blender/editors/object/object_shader_fx.c b/source/blender/editors/object/object_shader_fx.c index 585a1e22a84..7634c14ee0f 100644 --- a/source/blender/editors/object/object_shader_fx.c +++ b/source/blender/editors/object/object_shader_fx.c @@ -368,8 +368,12 @@ static bool edit_shaderfx_poll_generic(bContext *C, StructRNA *rna_type, int obt return false; } + if (!fx) { + return false; + } + if (ID_IS_OVERRIDE_LIBRARY(ob)) { - if ((fx == NULL) || (fx->flag & eShaderFxFlag_OverrideLibrary_Local) == 0) { + if ((fx->flag & eShaderFxFlag_OverrideLibrary_Local) == 0) { CTX_wm_operator_poll_msg_set(C, "Cannot edit shaderfxs coming from library override"); return false; } |