diff --git a/platformapi/mtwmapi/order.go b/platformapi/mtwmapi/order.go index 8aabe9cd..8587a931 100644 --- a/platformapi/mtwmapi/order.go +++ b/platformapi/mtwmapi/order.go @@ -599,7 +599,10 @@ func (a *API) GetDeliveryPath(orderId int64, appPoiCode string) (lng, lat int, e if err := json.Unmarshal(path, &riderPath); err != nil { return 0, 0, err } - return riderPath[len(riderPath)-1].Longitude, riderPath[len(riderPath)-1].Latitude, nil + if len(riderPath) > 0 { + return riderPath[len(riderPath)-1].Longitude, riderPath[len(riderPath)-1].Latitude, nil + } + return 0, 0, nil } // OrderLogisticsFee 获取订单配送费