It's a sporadic issue we spotted through automation (Sentry) so hard to tell how it could be reproduced but somehow the regexp pointer is nil when the code attempts to match.
runtime.errorString: runtime error: invalid memory address or nil pointer dereference
File "regexp/exec.go", line 527, in (*Regexp).doExecute
File "regexp/exec.go", line 514, in (*Regexp).doMatch
File "regexp/regexp.go", line 533, in (*Regexp).MatchString
File "github.com/gorilla/mux@v1.8.0/regexp.go", line 193, in (*routeRegexp).Match
File "github.com/gorilla/mux@v1.8.0/route.go", line 50, in (*Route).Match
File "github.com/gorilla/mux@v1.8.0/mux.go", line 138, in (*Router).Match
File "github.com/gorilla/mux@v1.8.0/route.go", line 50, in (*Route).Match
File "github.com/gorilla/mux@v1.8.0/mux.go", line 138, in (*Router).Match
File "github.com/gorilla/mux@v1.8.0/route.go", line 50, in (*Route).Match
File "github.com/gorilla/mux@v1.8.0/mux.go", line 138, in (*Router).Match
File "github.com/gorilla/mux@v1.8.0/mux.go", line 196, in (*Router).ServeHTTP
File "net/http/server.go", line 2109, in HandlerFunc.ServeHTTP
File "net/http/server.go", line 2947, in serverHandler.ServeHTTP
File "net/http/server.go", line 1991, in (*conn).serve
Is there an existing issue for this?
Current Behavior
Code panics
Expected Behavior
Not to panic but return an error
Steps To Reproduce
It's a sporadic issue we spotted through automation (Sentry) so hard to tell how it could be reproduced but somehow the regexp pointer is
nilwhen the code attempts to match.Anything else?
Stacktrace