1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-23 03:30:49 +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 {
//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)