Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-04-30 13:44:43 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-04-30 13:48:41 +0300
commitf4d5a69cf8512aafcc697d1b09f65489015b6af4 (patch)
treec3bd385704d734cd1e1ea7a7013ab64087117857 /source/blender/editors/object/object_shader_fx.c
parentd6b26b3fa0c46c6a9d9c9e5d3816a713dfa261a7 (diff)
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
Diffstat (limited to 'source/blender/editors/object/object_shader_fx.c')
-rw-r--r--source/blender/editors/object/object_shader_fx.c6
1 files changed, 5 insertions, 1 deletions
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;
}