mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Merge pull request #112853 from aaronp64/dictionary_error_key
Include key in `Dictionary::operator[]` error message
This commit is contained in:
commit
2c11facde0
1 changed files with 1 additions and 1 deletions
|
|
@ -133,7 +133,7 @@ const Variant &Dictionary::operator[](const Variant &p_key) const {
|
||||||
} else {
|
} else {
|
||||||
static Variant empty;
|
static Variant empty;
|
||||||
const Variant *value = _p->variant_map.getptr(key);
|
const Variant *value = _p->variant_map.getptr(key);
|
||||||
ERR_FAIL_COND_V_MSG(!value, empty, "Bug: Dictionary::operator[] used when there was no value for the given key, please report.");
|
ERR_FAIL_COND_V_MSG(!value, empty, vformat(R"(Bug: Dictionary::operator[] used when there was no value for the given key "%s". Please report.)", key));
|
||||||
return *value;
|
return *value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue