Check optional before it's used
This commit is contained in:
parent
4e753a6024
commit
1fb5f23885
1 changed files with 1 additions and 1 deletions
|
@ -34,7 +34,7 @@ void Game::eatPellets() {
|
||||||
void Game::processEvents(InputState & inputState) {
|
void Game::processEvents(InputState & inputState) {
|
||||||
|
|
||||||
auto event = canvas.pollEvent();
|
auto event = canvas.pollEvent();
|
||||||
if (event->type == sf::Event::Closed) {
|
if (event && event->type == sf::Event::Closed) {
|
||||||
inputState.close = true;
|
inputState.close = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue