diff --git a/lib/Game.cpp b/lib/Game.cpp index e99be4d..619e017 100644 --- a/lib/Game.cpp +++ b/lib/Game.cpp @@ -34,7 +34,7 @@ void Game::eatPellets() { void Game::processEvents(InputState & inputState) { auto event = canvas.pollEvent(); - if (event->type == sf::Event::Closed) { + if (event && event->type == sf::Event::Closed) { inputState.close = true; return; }