fix the routerInfo is nil

This commit is contained in:
astaxie 2018-11-09 18:03:26 +08:00
parent 24885c28f2
commit 876dce8e54
1 changed files with 1 additions and 1 deletions

View File

@ -798,7 +798,7 @@ func (p *ControllerRegister) ServeHTTP(rw http.ResponseWriter, r *http.Request)
if !isRunnable {
//Invoke the request handler
var execController ControllerInterface
if routerInfo.initialize != nil {
if routerInfo != nil && routerInfo.initialize != nil {
execController = routerInfo.initialize()
} else {
vc := reflect.New(runRouter)