fix runrouter is nil
Showing
1 changed file
with
6 additions
and
1 deletions
| ... | @@ -846,7 +846,12 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request) | ... | @@ -846,7 +846,12 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request) |
| 846 | Admin: | 846 | Admin: |
| 847 | //admin module record QPS | 847 | //admin module record QPS |
| 848 | if EnableAdmin { | 848 | if EnableAdmin { |
| 849 | go admin.StatisticsMap.AddStatistics(r.Method, requestPath, runrouter.controllerType.Name(), time.Since(starttime)) | 849 | if runrouter != nil { |
| 850 | go admin.StatisticsMap.AddStatistics(r.Method, requestPath, runrouter.controllerType.Name(), time.Since(starttime)) | ||
| 851 | } else { | ||
| 852 | go admin.StatisticsMap.AddStatistics(r.Method, requestPath, "", time.Since(starttime)) | ||
| 853 | } | ||
| 854 | |||
| 850 | } | 855 | } |
| 851 | } | 856 | } |
| 852 | 857 | ... | ... |
-
Please register or sign in to post a comment