diff options
Diffstat (limited to 'core/src/ch/asynk/tankontank')
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/TileSet.java | 1 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Hex.java | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/TileSet.java b/core/src/ch/asynk/tankontank/engine/TileSet.java index 07dc8ad..5a75b5d 100644 --- a/core/src/ch/asynk/tankontank/engine/TileSet.java +++ b/core/src/ch/asynk/tankontank/engine/TileSet.java @@ -18,6 +18,7 @@ public class TileSet extends LinkedHashSet<Tile> implements Board.TileCollection public Tile first() { + if (isEmpty()) return null; return iterator().next(); } diff --git a/core/src/ch/asynk/tankontank/game/Hex.java b/core/src/ch/asynk/tankontank/game/Hex.java index 77b8bfd..b357e56 100644 --- a/core/src/ch/asynk/tankontank/game/Hex.java +++ b/core/src/ch/asynk/tankontank/game/Hex.java @@ -47,6 +47,7 @@ public class Hex extends Tile public Unit getUnit() { + if (isEmpty()) return null; return (Unit) iterator().next(); } |