Fix wrong block statements consuming EOF token, causing a nullptr exception
This commit is contained in:
@@ -11,7 +11,7 @@ ParsedScriptStatement* Parser::Parse() {
|
||||
vector<ParsedStatement*> statements;
|
||||
while (true){
|
||||
auto next = this -> Next();
|
||||
if (next->GetKind() == TokenKind::EndOfFile){
|
||||
if (next == nullptr || next->GetKind() == TokenKind::EndOfFile){
|
||||
break;
|
||||
}
|
||||
statements.push_back(this -> ParseStatement(next));
|
||||
|
||||
Reference in New Issue
Block a user