Fix crash running constraint, modifier, fx from missing NULL check
None of these generic poll functions had NULL pointer checks, since all operators that use these functions expect a valid constraint, modifier .. etc. Add the NULL check to the poll function. Ref D11126 Reviewed By: mont29, Severin
This commit is contained in:
parent
d6b26b3fa0
commit
f4d5a69cf8
Notes:
blender-bot
2023-02-14 04:24:05 +01:00
Referenced by commit 99eca899c0
, Revert "Fix crash running constraint, modifier, fx from missing NULL check"
|
@ -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");
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue