Permalink
Browse files

error on nil route

Signed-off-by: Peter Edge <peter.edge@gmail.com>
  • Loading branch information...
peter-edge committed Jan 25, 2016
1 parent 1d49b72 commit 80f9e6e6aea4c76273ed4c718070bde05560118d
Showing with 3 additions and 0 deletions.
  1. +3 −0 server_client.go
@@ -84,6 +84,9 @@ func (s *serverClient) GetMiles(request *GetMilesRequest) (*GetMilesResponse, er
}

func getSegmentsWithoutMiles(route string) ([]*GetMilesResponse_Segment, error) {
if route == "" {
return nil, fmt.Errorf("openflights: no route specified")
}
var segmentStrings []string
for _, segmentString := range strings.Split(route, "/") {
segmentString = strings.TrimSpace(segmentString)

0 comments on commit 80f9e6e

Please sign in to comment.