Skip to content

Commit 61e19a3

Browse files
committed
fix crash when undoing if there were no snapshots
1 parent 2967cde commit 61e19a3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/gui/game/GameController.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,8 @@ GameController::~GameController()
233233
void GameController::HistoryRestore()
234234
{
235235
std::deque<Snapshot*> history = gameModel->GetHistory();
236+
if (!history.size())
237+
return;
236238
unsigned int historyPosition = gameModel->GetHistoryPosition();
237239
unsigned int newHistoryPosition = std::max((int)historyPosition-1, 0);
238240
// When undoing, save the current state as a final redo

0 commit comments

Comments
 (0)