diff --git a/src/gui/game/GameController.cpp b/src/gui/game/GameController.cpp index 25ec67582..a0f7ee4fb 100644 --- a/src/gui/game/GameController.cpp +++ b/src/gui/game/GameController.cpp @@ -233,6 +233,8 @@ GameController::~GameController() void GameController::HistoryRestore() { std::deque history = gameModel->GetHistory(); + if (!history.size()) + return; unsigned int historyPosition = gameModel->GetHistoryPosition(); unsigned int newHistoryPosition = std::max((int)historyPosition-1, 0); // When undoing, save the current state as a final redo