diff --git a/src/main/java/com/chint/domain/aggregates/order/Leg.java b/src/main/java/com/chint/domain/aggregates/order/Leg.java index 9548aca7..830bb669 100644 --- a/src/main/java/com/chint/domain/aggregates/order/Leg.java +++ b/src/main/java/com/chint/domain/aggregates/order/Leg.java @@ -436,11 +436,11 @@ public class Leg implements Serializable, EventManageable { public Leg restoreFromLegString(String legString) { String[] parts = legString.split("\\|"); if (parts.length == 5) { - this.startTime = DateTimeUtil.strToTime(parts[0]); - this.endTime = DateTimeUtil.strToTime(parts[1]); - this.originId = Long.parseLong(parts[2]); - this.destinationId = Long.parseLong(parts[3]); - this.estimateAmount = parts[4]; + this.startTime = parts[0] != null ? DateTimeUtil.strToTime(parts[0]) : null; + this.endTime = parts[1] != null ? DateTimeUtil.strToTime(parts[1]) : null; + this.originId = parts[2] != null ? Long.parseLong(parts[2]) : null; + this.destinationId = parts[3] != null ? Long.parseLong(parts[3]) : null; + this.estimateAmount = parts[4] != null ? parts[4] : null; } else { throw new IllegalArgumentException("Invalid legString format."); }