diff --git a/MekHQ/src/mekhq/campaign/finances/Money.java b/MekHQ/src/mekhq/campaign/finances/Money.java index 373f937006..856be6846d 100644 --- a/MekHQ/src/mekhq/campaign/finances/Money.java +++ b/MekHQ/src/mekhq/campaign/finances/Money.java @@ -102,6 +102,10 @@ public Money absolute() { } public Money plus(Money amount) { + if (amount == null) { + return plus(0L); + } + return new Money(getWrapped().plus(amount.getWrapped())); } @@ -114,6 +118,10 @@ public Money plus(List amounts) { } public Money minus(Money amount) { + if (amount == null) { + return minus(0L); + } + return new Money(getWrapped().minus(amount.getWrapped())); } diff --git a/MekHQ/src/mekhq/campaign/parts/BattleArmorSuit.java b/MekHQ/src/mekhq/campaign/parts/BattleArmorSuit.java index 03d95668df..c5d09142df 100644 --- a/MekHQ/src/mekhq/campaign/parts/BattleArmorSuit.java +++ b/MekHQ/src/mekhq/campaign/parts/BattleArmorSuit.java @@ -235,7 +235,7 @@ public Money getStickerPrice() { //if there are no linked parts and the unit is null, //then use the pre-recorded alternate costs if ((null == unit) && !hasChildParts()) { - return alternateCost; + return (alternateCost != null) ? alternateCost : Money.zero(); } Money cost = Money.zero(); switch(weightClass) {