diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-28 17:22:17 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-28 17:22:17 +0100 |
commit | e37862758d66e4d4caa259e3b27ca4db04f7ce10 (patch) | |
tree | d70174dd43b309572d1d3e58a79a5c56687c34c3 /core/src/ch/asynk/tankontank/game | |
parent | 4c6e80e4ee0cbc669a7fc160d19fa1eb8babd3fc (diff) | |
download | RustAndDust-e37862758d66e4d4caa259e3b27ca4db04f7ce10.zip RustAndDust-e37862758d66e4d4caa259e3b27ca4db04f7ce10.tar.gz |
TileSet,Hex: do not crash callint iterator().next() when empty
Diffstat (limited to 'core/src/ch/asynk/tankontank/game')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Hex.java | 1 |
1 files changed, 1 insertions, 0 deletions
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(); } |