From 117b1c3da18211bf72e8971a36692a4b0633cf37 Mon Sep 17 00:00:00 2001 From: aaronp64 Date: Wed, 9 Apr 2025 12:22:48 -0400 Subject: [PATCH] Use validated key in Dictionary::has Updated Dictionary::has to use validated key when checking variant_map, to handle cases when passed in key is converted to Dictionary's key type. --- core/variant/dictionary.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/variant/dictionary.cpp b/core/variant/dictionary.cpp index 6d89e3a1ae..48164e30bd 100644 --- a/core/variant/dictionary.cpp +++ b/core/variant/dictionary.cpp @@ -218,7 +218,7 @@ bool Dictionary::is_empty() const { bool Dictionary::has(const Variant &p_key) const { Variant key = p_key; ERR_FAIL_COND_V(!_p->typed_key.validate(key, "use 'has'"), false); - return _p->variant_map.has(p_key); + return _p->variant_map.has(key); } bool Dictionary::has_all(const Array &p_keys) const {