From b1add5a293475163390640c90715b42daa8cd6fc Mon Sep 17 00:00:00 2001 From: lulz1 Date: Wed, 3 Jul 2024 14:23:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=9B=A0=E4=B8=BAnull=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E6=97=A0=E6=B3=95leg=E7=8A=B6=E6=80=81=E5=9B=9E=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/chint/domain/aggregates/order/Leg.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 830bb669..11b6cd4c 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 = 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; + this.startTime = parts[0] != null && !"null".equals(parts[0]) ? DateTimeUtil.strToTime(parts[0]) : null; + this.endTime = parts[1] != null && !"null".equals(parts[1]) ? DateTimeUtil.strToTime(parts[1]) : null; + this.originId = parts[2] != null && !"null".equals(parts[2]) ? Long.parseLong(parts[2]) : null; + this.destinationId = parts[3] != null && !"null".equals(parts[3]) ? Long.parseLong(parts[3]) : null; + this.estimateAmount = parts[4] != null && !"null".equals(parts[4]) ? parts[4] : null; } else { throw new IllegalArgumentException("Invalid legString format."); }