Fixed NPE errors in deck editor;

This commit is contained in:
Oleg Agafonov 2020-01-05 02:03:01 +04:00
parent 3ce1296886
commit 9110f70e2d

View file

@ -292,6 +292,9 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
*/
@Override
public Abilities<Ability> getAbilities(Game game) {
if (game == null) {
return abilities; // deck editor with empty game
}
CardState cardState = game.getState().getCardState(this.getId());
if (!cardState.hasLostAllAbilities() && (cardState.getAbilities() == null || cardState.getAbilities().isEmpty())) {
return abilities;