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:
authorBastien Montagne <bastien@blender.org>2020-10-13 21:34:18 +0300
committerBastien Montagne <bastien@blender.org>2020-10-13 21:38:04 +0300
commit72cfeb2c4ee38eb53b805ac775b5809b1df65660 (patch)
treed05c464d5271a8f43d81019531aa981f379f122b /source/blender/editors/interface/interface_ops.c
parentbe3841b1bf5f10acd1163189b689de1f1dd6d86c (diff)
Fix T81674: LibOverride: 'Define Override' UI operation can crash.
Case where RNA is not able to generate a proper path for a property was not taken into account properly.
Diffstat (limited to 'source/blender/editors/interface/interface_ops.c')
-rw-r--r--source/blender/editors/interface/interface_ops.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c
index c9f21c7fc2e..4cb8a47690e 100644
--- a/source/blender/editors/interface/interface_ops.c
+++ b/source/blender/editors/interface/interface_ops.c
@@ -558,6 +558,13 @@ static int override_type_set_button_exec(bContext *C, wmOperator *op)
IDOverrideLibraryPropertyOperation *opop = RNA_property_override_property_operation_get(
CTX_data_main(C), &ptr, prop, operation, index, true, NULL, &created);
+
+ if (opop == NULL) {
+ /* Sometimes e.g. RNA cannot generate a path to the given property. */
+ BKE_reportf(op->reports, RPT_WARNING, "Failed to create the override operation");
+ return OPERATOR_CANCELLED;
+ }
+
if (!created) {
opop->operation = operation;
}