From 90815bffc416c98e06c7410159419639330fd22e Mon Sep 17 00:00:00 2001 From: zjj Date: Sun, 27 Oct 2024 15:33:26 +0800 Subject: [PATCH] enhance code imported by #3413 if it needs to check if the handler is nil, tie c.index shall always ++ --- context.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/context.go b/context.go index 77232f90..ebfa79d1 100644 --- a/context.go +++ b/context.go @@ -186,10 +186,9 @@ func (c *Context) FullPath() string { func (c *Context) Next() { c.index++ for c.index < int8(len(c.handlers)) { - if c.handlers[c.index] == nil { - continue + if c.handlers[c.index] != nil { + c.handlers[c.index](c) } - c.handlers[c.index](c) c.index++ } }