From 4032255694a36e90faeba6c124a580d9124f5eca Mon Sep 17 00:00:00 2001 From: momo <1012651275@qq.com> Date: Thu, 28 Sep 2023 10:51:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/repositories/order.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/service/repositories/order.go b/service/repositories/order.go index 87157211..d23c170d 100644 --- a/service/repositories/order.go +++ b/service/repositories/order.go @@ -987,7 +987,11 @@ func (d *defaultOrder) Create(ctx context.Context, in *CreateReq) (res *CreateRe var statusLink = order.GenerateOrderStatusLink(in.DeliveryMethod, nowTime, in.ExpectedDeliveryTime) byteOrderProduct, _ := json.Marshal(orderProductList) - byteOrderAddress, _ := json.Marshal(orderAddress) + var byteOrderAddress []byte + if orderAddress != nil { + byteOrderAddress, _ = json.Marshal(orderAddress) + } + byteOrderAmount, _ := json.Marshal(orderAmount) byteShoppingCartSnapshot, _ := json.Marshal(shoppingCartSnapshotList) byteShoppingProductSnapshot, _ := json.Marshal(shoppingProductSnapshotList)