1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Merge pull request #44719 from ThakeeNathees/assert-argument-bug-fixed

GDScript assert message parsing bug fixed
This commit is contained in:
Rémi Verschelde
2021-01-11 13:51:44 +01:00
committed by GitHub
3 changed files with 8 additions and 8 deletions

View File

@@ -1503,12 +1503,9 @@ GDScriptParser::AssertNode *GDScriptParser::parse_assert() {
if (match(GDScriptTokenizer::Token::COMMA)) {
// Error message.
if (consume(GDScriptTokenizer::Token::LITERAL, R"(Expected error message for assert after ",".)")) {
assert->message = parse_literal();
if (assert->message->value.get_type() != Variant::STRING) {
push_error(R"(Expected string for assert error message.)");
}
} else {
assert->message = parse_expression(false);
if (assert->message == nullptr) {
push_error(R"(Expected error message for assert after ",".)");
return nullptr;
}
}