From 44b2747dfd0a91b90c95f00a214dead97fb41bf7 Mon Sep 17 00:00:00 2001 From: cdemirer <41021322+cdemirer@users.noreply.github.com> Date: Mon, 11 Jul 2022 20:11:27 +0300 Subject: Fix `Variant::in()` error on invalid `evaluate` --- core/variant/variant_op.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'core') diff --git a/core/variant/variant_op.cpp b/core/variant/variant_op.cpp index 59f562865d..33c285dc6d 100644 --- a/core/variant/variant_op.cpp +++ b/core/variant/variant_op.cpp @@ -1105,8 +1105,11 @@ bool Variant::in(const Variant &p_index, bool *r_valid) const { evaluate(OP_IN, p_index, *this, ret, valid); if (r_valid) { *r_valid = valid; + } + if (valid) { + ERR_FAIL_COND_V(ret.type != BOOL, false); + return *VariantGetInternalPtr::get_ptr(&ret); + } else { return false; } - ERR_FAIL_COND_V(ret.type != BOOL, false); - return *VariantGetInternalPtr::get_ptr(&ret); } -- cgit v1.2.3