Merge pull request #82639 from golfinq/gdscript-improve-indexing-error

GDScript: Improve error messages for invalid indexing
This commit is contained in:
Rémi Verschelde 2024-01-04 16:38:58 +01:00
commit 2bffa3cbc5
No known key found for this signature in database
GPG key ID: C3336907360768E1
10 changed files with 87 additions and 29 deletions

View file

@ -3636,7 +3636,7 @@ void GDScriptAnalyzer::reduce_identifier_from_base(GDScriptParser::IdentifierNod
switch (base.builtin_type) {
case Variant::NIL: {
if (base.is_hard_type()) {
push_error(vformat(R"(Invalid get index "%s" on base Nil)", name), p_identifier);
push_error(vformat(R"(Cannot get property "%s" on a null object.)", name), p_identifier);
}
return;
}