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:
authorHans Goudey <h.goudey@me.com>2021-09-21 04:22:52 +0300
committerHans Goudey <h.goudey@me.com>2021-09-21 04:22:52 +0300
commit9e939a614ec5cda5dd6e5392bf9c209d21127c33 (patch)
treee433ef343c86ea10f25c4e1a3c1229b5503f59df
parent4472a11017a0c48f77df26d990df2016f457058d (diff)
Functions: Fix incorrect assert for unused output
Since the variable for an output parameter can be null, it is incorrect to use it later on in a reference.
-rw-r--r--source/blender/functions/intern/multi_function_procedure.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/functions/intern/multi_function_procedure.cc b/source/blender/functions/intern/multi_function_procedure.cc
index fa95e8de71e..986c5dff0c4 100644
--- a/source/blender/functions/intern/multi_function_procedure.cc
+++ b/source/blender/functions/intern/multi_function_procedure.cc
@@ -419,6 +419,10 @@ bool MFProcedure::validate_initialization() const
const MultiFunction &fn = *instruction->fn_;
for (const int param_index : fn.param_indices()) {
const MFParamType param_type = fn.param_type(param_index);
+ /* If the parameter was an unneeded output, it could be null. */
+ if (!instruction->params_[param_index]) {
+ continue;
+ }
const MFVariable &variable = *instruction->params_[param_index];
const InitState state = this->find_initialization_state_before_instruction(*instruction,
variable);