1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 15:00:54 +00:00

fix the routerInfo is nil

This commit is contained in:
astaxie 2018-11-09 18:03:26 +08:00
parent 24885c28f2
commit 876dce8e54

View File

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