File tree 2 files changed +9
-1
lines changed
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -102,6 +102,10 @@ public Money absolute() {
102
102
}
103
103
104
104
public Money plus (Money amount ) {
105
+ if (amount == null ) {
106
+ return plus (0L );
107
+ }
108
+
105
109
return new Money (getWrapped ().plus (amount .getWrapped ()));
106
110
}
107
111
@@ -114,6 +118,10 @@ public Money plus(List<Money> amounts) {
114
118
}
115
119
116
120
public Money minus (Money amount ) {
121
+ if (amount == null ) {
122
+ return minus (0L );
123
+ }
124
+
117
125
return new Money (getWrapped ().minus (amount .getWrapped ()));
118
126
}
119
127
Original file line number Diff line number Diff line change @@ -235,7 +235,7 @@ public Money getStickerPrice() {
235
235
//if there are no linked parts and the unit is null,
236
236
//then use the pre-recorded alternate costs
237
237
if ((null == unit ) && !hasChildParts ()) {
238
- return alternateCost ;
238
+ return ( alternateCost != null ) ? alternateCost : Money . zero () ;
239
239
}
240
240
Money cost = Money .zero ();
241
241
switch (weightClass ) {
You can’t perform that action at this time.
0 commit comments