remove try catch
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package chess.model;
|
||||
|
||||
import java.util.EmptyStackException;
|
||||
import java.util.Stack;
|
||||
|
||||
import chess.controller.PlayerCommand;
|
||||
@@ -92,12 +91,9 @@ public class Game {
|
||||
}
|
||||
|
||||
public PlayerCommand getLastAction() {
|
||||
try {
|
||||
PlayerCommand last = this.movesHistory.pop();
|
||||
return last;
|
||||
} catch (EmptyStackException e) {
|
||||
if (this.movesHistory.isEmpty())
|
||||
return null;
|
||||
}
|
||||
return this.movesHistory.pop();
|
||||
}
|
||||
|
||||
public void updateLastMove() {
|
||||
|
||||
Reference in New Issue
Block a user