Skip to content

Commit

Permalink
Update OrderFreightCostsService.java
Browse files Browse the repository at this point in the history
avoid NPE when shipToBPartnerId is not set yet

#5380
  • Loading branch information
teosarca committed Jul 16, 2019
1 parent 5e80026 commit 3afc112
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -196,7 +196,9 @@ private FreightCostContext extractFreightCostContext(final I_C_Order order)
final FreightCostRule freightCostRule = FreightCostRule.ofNullableCodeOr(order.getFreightCostRule(), FreightCostRule.FreightIncluded);

final ShipperId orderShipperid = ShipperId.ofRepoIdOrNull(order.getM_Shipper_ID());
final ShipperId partnerShipperId = bpartnerBL.getShipperIdOrNull(shipToBPartnerId);
final ShipperId partnerShipperId = shipToBPartnerId != null
? bpartnerBL.getShipperIdOrNull(shipToBPartnerId)
: null;

return FreightCostContext.builder()
.shipFromOrgId(OrgId.ofRepoId(order.getC_Order_ID()))
Expand Down

0 comments on commit 3afc112

Please sign in to comment.