remove try catch

This commit is contained in:
2025-04-05 19:22:15 +02:00
parent d94f7d733b
commit 381e5ed0b8

View File

@@ -1,6 +1,5 @@
package chess.model; package chess.model;
import java.util.EmptyStackException;
import java.util.Stack; import java.util.Stack;
import chess.controller.PlayerCommand; import chess.controller.PlayerCommand;
@@ -92,12 +91,9 @@ public class Game {
} }
public PlayerCommand getLastAction() { public PlayerCommand getLastAction() {
try { if (this.movesHistory.isEmpty())
PlayerCommand last = this.movesHistory.pop();
return last;
} catch (EmptyStackException e) {
return null; return null;
} return this.movesHistory.pop();
} }
public void updateLastMove() { public void updateLastMove() {