Skip to content

Commit

Permalink
Handle nulls in recursive process for findHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
mariomenjr committed Apr 27, 2022
1 parent 71561d3 commit dfb32bc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions router.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ func (rt *Router) findHandler(r *http.Request) *ActionHandler {
for _, v := range rt.children {
if v.handler != nil && v.isMatch(r) {
return v.handler
} else {
return v.findHandler(r)
}
x := v.findHandler(r)
if x != nil {
return x
}
}
return nil
Expand Down

0 comments on commit dfb32bc

Please sign in to comment.