Merge pull request #96864 from KoBeWi/dictionerrory

Fix `Dictionary.merge()` type validation
This commit is contained in:
Rémi Verschelde 2024-09-12 09:25:42 +02:00
commit 60ffa9645a
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 1 additions and 1 deletions

View File

@ -261,7 +261,7 @@ void Dictionary::merge(const Dictionary &p_dictionary, bool p_overwrite) {
Variant key = E.key;
Variant value = E.value;
ERR_FAIL_COND(!_p->typed_key.validate(key, "merge"));
ERR_FAIL_COND(!_p->typed_key.validate(value, "merge"));
ERR_FAIL_COND(!_p->typed_value.validate(value, "merge"));
if (p_overwrite || !has(key)) {
operator[](key) = value;
}