diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index 336b6d95..a2940eb3 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -634,18 +634,27 @@ namespace Myshipping.Application { if (currStatusList.Any(a => a.StatusSKUCode.Equals("YFVGM", StringComparison.OrdinalIgnoreCase) && a.IsYield)) { - item.IsVGM = currStatusList.FirstOrDefault(a => - a.StatusSKUCode.Equals("YFVGM", StringComparison.OrdinalIgnoreCase) && a.IsYield).ActDate.Value; + var currStus = currStatusList.FirstOrDefault(a => + a.StatusSKUCode.Equals("YFVGM", StringComparison.OrdinalIgnoreCase) && a.IsYield); + + if(currStus != null) + item.IsVGM = currStus?.ActDate.Value; } if (currStatusList.Any(a => a.StatusSKUCode.Equals("YFCD", StringComparison.OrdinalIgnoreCase) && a.IsYield)) { - item.IsCanDan = currStatusList.FirstOrDefault(a => - a.StatusSKUCode.Equals("YFCD", StringComparison.OrdinalIgnoreCase) && a.IsYield).ActDate.Value; + var currStus = currStatusList.FirstOrDefault(a => + a.StatusSKUCode.Equals("YFCD", StringComparison.OrdinalIgnoreCase) && a.IsYield); + + if (currStus != null) + item.IsCanDan = currStus?.ActDate.Value; } if (currStatusList.Any(a => a.StatusSKUCode.Equals("ZZFX", StringComparison.OrdinalIgnoreCase) && a.IsYield)) { - item.IsZZFX = currStatusList.FirstOrDefault(a => - a.StatusSKUCode.Equals("ZZFX", StringComparison.OrdinalIgnoreCase) && a.IsYield).ActDate.Value; + var currStus = currStatusList.FirstOrDefault(a => + a.StatusSKUCode.Equals("ZZFX", StringComparison.OrdinalIgnoreCase) && a.IsYield); + + if (currStus != null) + item.IsZZFX = currStus?.ActDate.Value; } item.GoodsStatusList = currStatusList.OrderBy(a => a.CalcSortNo)