You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
GDScript: Improve error messages for invalid indexing
These errors are very common when using an invalid property name or calling on an object of the wrong type, and the previous message was a bit cryptic for users. Co-authored-by: Rémi Verschelde <rverschelde@gmail.com> Co-authored-by: golfinq <golfinqz@gmail.com>
This commit is contained in:
@@ -3595,7 +3595,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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user