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:
-rw-r--r--source/blender/editors/object/object_constraint.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c
index d717271b9cb..3f4ed27a175 100644
--- a/source/blender/editors/object/object_constraint.c
+++ b/source/blender/editors/object/object_constraint.c
@@ -1443,6 +1443,11 @@ static int constraint_delete_exec(bContext *C, wmOperator *op)
Main *bmain = CTX_data_main(C);
Object *ob = ED_object_active_context(C);
bConstraint *con = edit_constraint_property_get(C, op, ob, 0);
+
+ if (con == NULL) {
+ return OPERATOR_CANCELLED;
+ }
+
ListBase *lb = ED_object_constraint_list_from_constraint(ob, con, NULL);
/* Store name temporarily for report. */
@@ -1510,6 +1515,11 @@ static int constraint_apply_exec(bContext *C, wmOperator *op)
Main *bmain = CTX_data_main(C);
Object *ob = ED_object_active_context(C);
bConstraint *con = edit_constraint_property_get(C, op, ob, 0);
+
+ if (con == NULL) {
+ return OPERATOR_CANCELLED;
+ }
+
bPoseChannel *pchan;
ListBase *constraints = ED_object_constraint_list_from_constraint(ob, con, &pchan);
@@ -1602,6 +1612,11 @@ static int constraint_copy_exec(bContext *C, wmOperator *op)
Main *bmain = CTX_data_main(C);
Object *ob = ED_object_active_context(C);
bConstraint *con = edit_constraint_property_get(C, op, ob, 0);
+
+ if (con == NULL) {
+ return OPERATOR_CANCELLED;
+ }
+
bPoseChannel *pchan;
ListBase *constraints = ED_object_constraint_list_from_constraint(ob, con, &pchan);
@@ -1682,6 +1697,11 @@ static int constraint_copy_to_selected_exec(bContext *C, wmOperator *op)
Main *bmain = CTX_data_main(C);
Object *obact = ED_object_active_context(C);
bConstraint *con = edit_constraint_property_get(C, op, obact, 0);
+
+ if (con == NULL) {
+ return OPERATOR_CANCELLED;
+ }
+
bPoseChannel *pchan;
ED_object_constraint_list_from_constraint(obact, con, &pchan);