- NPE prevention in getAllNonPromoCards.

This commit is contained in:
Michael Kamensky
2021-03-19 20:52:44 +03:00
parent 7027a38fa4
commit 00b5d40de7

View File

@@ -555,7 +555,13 @@ public final class CardDb implements ICardDatabase, IDeckGenPool {
return Lists.newArrayList(Iterables.filter(this.roAllCards, new Predicate<PaperCard>() {
@Override
public boolean apply(final PaperCard paperCard) {
return editions.getEditionByCodeOrThrow(paperCard.getEdition()).getType() != Type.PROMOS;
CardEdition edition = null;
try {
edition = editions.getEditionByCodeOrThrow(paperCard.getEdition());
} catch (Exception ex) {
return false;
}
return edition != null && edition.getType() != Type.PROMOS;
}
}));
}