Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(context): check handler is nil #3413

Merged
merged 4 commits into from
May 13, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions context.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@
func (c *Context) HandlerNames() []string {
hn := make([]string, 0, len(c.handlers))
for _, val := range c.handlers {
if val == nil {
continue

Check warning on line 156 in context.go

View check run for this annotation

Codecov / codecov/patch

context.go#L156

Added line #L156 was not covered by tests
}
hn = append(hn, nameOfFunction(val))
}
return hn
Expand Down Expand Up @@ -182,6 +185,9 @@
func (c *Context) Next() {
c.index++
for c.index < int8(len(c.handlers)) {
if c.handlers[c.index] == nil {
continue

Check warning on line 189 in context.go

View check run for this annotation

Codecov / codecov/patch

context.go#L189

Added line #L189 was not covered by tests
}
c.handlers[c.index](c)
c.index++
}
Expand Down
Loading