summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank/engine
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-10-28 17:22:17 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-10-28 17:22:17 +0100
commite37862758d66e4d4caa259e3b27ca4db04f7ce10 (patch)
treed70174dd43b309572d1d3e58a79a5c56687c34c3 /core/src/ch/asynk/tankontank/engine
parent4c6e80e4ee0cbc669a7fc160d19fa1eb8babd3fc (diff)
downloadRustAndDust-e37862758d66e4d4caa259e3b27ca4db04f7ce10.zip
RustAndDust-e37862758d66e4d4caa259e3b27ca4db04f7ce10.tar.gz
TileSet,Hex: do not crash callint iterator().next() when empty
Diffstat (limited to 'core/src/ch/asynk/tankontank/engine')
-rw-r--r--core/src/ch/asynk/tankontank/engine/TileSet.java1
1 files changed, 1 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();
}