summaryrefslogtreecommitdiffstats
path: root/src/jrummikub
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2011-05-09 00:33:30 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2011-05-09 00:33:30 +0200
commitb57a2d5090cc1c6460b1ce806713964af9ec60f4 (patch)
treeb49485a5746ce8f09fb20ac282f847864b08b83c /src/jrummikub
parentec2936a034c845d2c1e561ee1bc1860be0964933 (diff)
downloadJRummikub-b57a2d5090cc1c6460b1ce806713964af9ec60f4.tar
JRummikub-b57a2d5090cc1c6460b1ce806713964af9ec60f4.zip
Allow calling pickUpStone for nonexistant stones
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@178 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src/jrummikub')
-rw-r--r--src/jrummikub/model/Table.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/jrummikub/model/Table.java b/src/jrummikub/model/Table.java
index a763bef..7787bea 100644
--- a/src/jrummikub/model/Table.java
+++ b/src/jrummikub/model/Table.java
@@ -28,6 +28,10 @@ public class Table extends StoneTray<StoneSet> implements ITable {
public Pair<StoneSet, StoneSet> pickUpStone(Stone stone) {
StoneInfo info = findStoneInfo(stone);
+ if (info == null) {
+ return null;
+ }
+
return splitSet(info.set, info.setPosition, info.stonePosition);
}