mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
* Sylvan Library- Fixed possible null pointer exception.
This commit is contained in:
parent
a281a19a7d
commit
d40afd9ef5
1 changed files with 2 additions and 1 deletions
|
@ -105,8 +105,9 @@ class SylvanLibraryEffect extends OneShotEffect {
|
||||||
CardsDrawnThisTurnWatcher watcher = (CardsDrawnThisTurnWatcher) game.getState().getWatchers().get("CardsDrawnThisTurnWatcher");
|
CardsDrawnThisTurnWatcher watcher = (CardsDrawnThisTurnWatcher) game.getState().getWatchers().get("CardsDrawnThisTurnWatcher");
|
||||||
if (watcher != null) {
|
if (watcher != null) {
|
||||||
Cards cards = new CardsImpl();
|
Cards cards = new CardsImpl();
|
||||||
|
Set<UUID> cardsDrawnThisTurn = watcher.getCardsDrawnThisTurn(controller.getId());
|
||||||
for (UUID cardId : controller.getHand()) {
|
for (UUID cardId : controller.getHand()) {
|
||||||
if (watcher.getCardsDrawnThisTurn(controller.getId()).contains(cardId)) {
|
if (cardsDrawnThisTurn != null && cardsDrawnThisTurn.contains(cardId)) {
|
||||||
Card card = game.getCard(cardId);
|
Card card = game.getCard(cardId);
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
cards.add(card);
|
cards.add(card);
|
||||||
|
|
Loading…
Reference in a new issue