Fix `Variant::in()` error on invalid `evaluate`

This commit is contained in:
cdemirer 2022-07-11 20:11:27 +03:00 committed by Rémi Verschelde
parent b7723a01d9
commit 44b2747dfd
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 5 additions and 2 deletions

View File

@ -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<bool>::get_ptr(&ret);
} else {
return false;
}
ERR_FAIL_COND_V(ret.type != BOOL, false);
return *VariantGetInternalPtr<bool>::get_ptr(&ret);
}