From d535e945ffe9c4984854a6a2398785e9990fa11b Mon Sep 17 00:00:00 2001 From: Arnaud Delcasse Date: Wed, 29 Mar 2023 18:31:29 +0200 Subject: [PATCH] fix --- valhalla.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/valhalla.go b/valhalla.go index 2eb9cdd..d0b3da4 100644 --- a/valhalla.go +++ b/valhalla.go @@ -50,7 +50,7 @@ func (v *ValhallaRouting) Route(locations []orb.Point) (route *Route, err error) return nil, err } - if len(resp.Directions.Routes) < 1 { + if resp.Directions == nil || resp.Directions.Routes == nil || len(resp.Directions.Routes) < 1 { return nil, errors.New("no routes returnes by valhalla") }