diff --git a/src/Parser/Parser.cpp b/src/Parser/Parser.cpp index 912987e..e7e8a07 100644 --- a/src/Parser/Parser.cpp +++ b/src/Parser/Parser.cpp @@ -11,7 +11,7 @@ ParsedScriptStatement* Parser::Parse() { vector 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));