mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
fix NPE when library is empty
This commit is contained in:
parent
1d22d59c42
commit
c38d49358c
1 changed files with 121 additions and 118 deletions
|
@ -29,6 +29,7 @@
|
|||
package mage.sets.worldwake;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Outcome;
|
||||
import mage.Constants.Rarity;
|
||||
|
@ -52,7 +53,6 @@ import mage.target.common.TargetCardInHand;
|
|||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public class JaceTheMindSculptor extends CardImpl<JaceTheMindSculptor> {
|
||||
|
@ -115,8 +115,10 @@ class JaceTheMindSculptorEffect1 extends OneShotEffect<JaceTheMindSculptorEffect
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Player player = game.getPlayer(source.getFirstTarget());
|
||||
if (controller != null && player != null) {
|
||||
Card c = player.getLibrary().getFromTop(game);
|
||||
if (c != null) {
|
||||
Cards cards = new CardsImpl();
|
||||
cards.add(player.getLibrary().getFromTop(game));
|
||||
cards.add(c);
|
||||
controller.lookAtCards("Jace, the Mind Sculptor", cards, game);
|
||||
if (controller.chooseUse(outcome, "Do you wish to put card on the bottom of player's library?", game)) {
|
||||
Card card = player.getLibrary().removeFromTop(game);
|
||||
|
@ -126,6 +128,7 @@ class JaceTheMindSculptorEffect1 extends OneShotEffect<JaceTheMindSculptorEffect
|
|||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue