Fix wrong block statements consuming EOF token, causing a nullptr exception
This commit is contained in:
parent
e233616b8e
commit
ed6fbdbef0
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue