fix null-check in raging river and a watcher

This commit is contained in:
igoudt 2018-01-13 23:26:35 +01:00
parent ed3742b1e4
commit 7f319c2751
2 changed files with 8 additions and 5 deletions

View file

@ -152,9 +152,11 @@ class RagingRiverEffect extends OneShotEffect {
filter.add(Predicates.not(new AbilityPredicate(FlyingAbility.class)));
} else {
List<Permanent> leftLog = left.stream()
.filter(permanent -> permanent.getControllerId() != null)
.filter(permanent -> permanent.getControllerId().equals(defender.getId()))
.collect(Collectors.toList());
List<Permanent> rightLog = right.stream()
.filter(permanent -> permanent.getControllerId() != null)
.filter(permanent -> permanent.getControllerId().equals(defender.getId()))
.collect(Collectors.toList());

View file

@ -5,16 +5,17 @@
*/
package mage.watchers.common;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.UUID;
import mage.constants.WatcherScope;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.watchers.Watcher;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.UUID;
/**
*
* @author LevelX2 (spjspj)
@ -75,7 +76,7 @@ public class PermanentsEnteredBattlefieldYourLastTurnWatcher extends Watcher {
}
public List<Permanent> getPermanentsEnteringOnPlayersLastTurn(Game game, UUID playerId) {
if (game.getActivePlayerId() == playerId) {
if (game.getActivePlayerId().equals(playerId)) {
return enteringBattlefield.get(playerId);
}
return enteringBattlefieldLastTurn.get(playerId);