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_constraint.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_constraint.c')
-rw-r--r--source/blender/editors/object/object_constraint.c5
1 files changed, 5 insertions, 0 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");