From ed6fbdbef014b2da4d9f21be2ee6355b6b5a6ae8 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Sat, 8 Jun 2019 14:27:24 +0200 Subject: [PATCH] Fix wrong block statements consuming EOF token, causing a nullptr exception --- src/Parser/Parser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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));