[ROE] Fix NullPointerException on Realms Uncharted

. Closes #9123.
This commit is contained in:
Alex Vasile 2022-06-22 16:45:19 -04:00
parent 5aae6bf735
commit 868c9b0d48

View file

@ -69,9 +69,9 @@ class RealmsUnchartedEffect extends OneShotEffect {
if (player == null) {
return false;
}
TargetCardInLibrary target = new TargetCardWithDifferentNameInLibrary(0, 4, filter);
player.searchLibrary(target, source, game);
Cards cards = new CardsImpl(target.getTargets());
TargetCardInLibrary targetCards = new TargetCardWithDifferentNameInLibrary(0, 4, filter);
player.searchLibrary(targetCards, source, game);
Cards cards = new CardsImpl(targetCards.getTargets());
cards.retainZone(Zone.LIBRARY, game);
if (cards.isEmpty()) {
player.shuffleLibrary(source, game);
@ -81,7 +81,7 @@ class RealmsUnchartedEffect extends OneShotEffect {
if (cards.size() > 2) {
TargetOpponent targetOpponent = new TargetOpponent();
targetOpponent.setNotTarget(true);
player.choose(outcome, target, source, game);
player.choose(outcome, targetOpponent, source, game);
Player opponent = game.getPlayer(targetOpponent.getFirstTarget());
Cards cardsToKeep = new CardsImpl();
cardsToKeep.addAll(cards);