Skip to content

Commit

Permalink
avoid nil pointer dereference
Browse files Browse the repository at this point in the history
  • Loading branch information
okaybase committed Aug 11, 2021
1 parent e8503a0 commit d8521df
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions api/internal/handler/data_loader/route_export.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,14 @@ var (
func (h *Handler) ExportAllRoutes(c droplet.Context) (interface{}, error) {
routelist, err := h.routeStore.List(c.Context(), store.ListInput{})

if len(routelist.Rows) < 1 {
return nil, consts.ErrRouteData
}

if err != nil {
return nil, err
}

if len(routelist.Rows) < 1 {
return nil, consts.ErrRouteData
}

routes := []*entity.Route{}

for _, route := range routelist.Rows {
Expand Down

0 comments on commit d8521df

Please sign in to comment.