add nullchecks on watchers

This commit is contained in:
Ingmar Goudt 2019-01-06 00:35:15 +01:00
parent 5cab28182d
commit 95a31759b5
53 changed files with 134 additions and 85 deletions

View file

@ -24,6 +24,9 @@ public enum NoSpellsWereCastLastTurnCondition implements Condition {
}
CastSpellLastTurnWatcher watcher = (CastSpellLastTurnWatcher) game.getState().getWatchers().get(CastSpellLastTurnWatcher.class.getSimpleName());
if(watcher == null){
return false;
}
// if any player cast spell, return false
for (Integer count : watcher.getAmountOfSpellsCastOnPrevTurn().values()) {
if (count > 0) {