diff --git a/router.go b/router.go index 8620d71f..4c7dd761 100644 --- a/router.go +++ b/router.go @@ -846,7 +846,12 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request) Admin: //admin module record QPS if EnableAdmin { - go admin.StatisticsMap.AddStatistics(r.Method, requestPath, runrouter.controllerType.Name(), time.Since(starttime)) + if runrouter != nil { + go admin.StatisticsMap.AddStatistics(r.Method, requestPath, runrouter.controllerType.Name(), time.Since(starttime)) + } else { + go admin.StatisticsMap.AddStatistics(r.Method, requestPath, "", time.Since(starttime)) + } + } }