From 6d1a0189b26af30a342c958e722ef7342d871ff8 Mon Sep 17 00:00:00 2001 From: wet <1034391973@qq.com> Date: Wed, 31 May 2023 16:50:43 +0800 Subject: [PATCH] 1 --- .../Service/BookingOrder/BookingOrderService.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs index 721c5e3a..c0561324 100644 --- a/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs +++ b/Myshipping.Application/Service/BookingOrder/BookingOrderService.cs @@ -6143,8 +6143,17 @@ namespace Myshipping.Application throw Oops.Bah($"请求爬虫获取【云港通】出错:{msg}"); } JArray jarrData = jobjRtn.GetValue("data") as JArray; + if (jarrData==null|| jarrData.Count==0) { + throw Oops.Bah($"请求爬虫获取数据为空{rtn}"); + + } JObject it = jarrData[0] as JObject; JArray array = it.GetValue("data") as JArray; + if (array == null || array.Count == 0) + { + throw Oops.Bah($"请求爬虫获取数据为空{rtn}"); + } + JObject item = array[0] as JObject; var yjdk_time = item.GetDateTimeValue("yjdk_time");//预计到港时间 var yjlk_time = item.GetDateTimeValue("yjlk_time");//预计离港时间