set a new route ctx if rctx is nil#878
Conversation
| if rctx == nil { | ||
| rctx = chi.NewRouteContext() | ||
| } |
There was a problem hiding this comment.
Should we move this check above line 54 and replace if rctx != nil?
|
Hey @shedyfreak, @yurineydachin, @AndreiOslin, I'm just checking back on this PR and I wonder -- how do you trigger the #839 panic? Under what circumstance is the route context nil? Might be helpful to provide a test case for this too. @shedyfreak what's your thoughts on #878 (comment) ? |
|
It looks like #841 was submitted first and has a test case too. I'll follow up there. Thanks for the PR! |
VojtechVitek
left a comment
There was a problem hiding this comment.
Hi, @shedyfreak
After all, I prefer this fix over #841.
Can we move if rctx == nil { check to the below if branch to avoid the panic per https://github.com/go-chi/chi/pull/878/files#r1418718973?
Thank you
|
Superseded by #1008. Thank you for the PR! |
PR to solve #839