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)