add nil check as other applications

This commit is contained in:
wuxiang
2018-04-03 17:03:03 +08:00
parent f0862df9a7
commit 6287285c8a
+4
View File
@@ -64,8 +64,12 @@ func (s *syncStatManager) GetCounter(name string) StatCounter {
}
func (s *syncStatManager) Set(m StatManager) {
if m == nil {
return
}
s.Lock()
defer s.Unlock()
s.StatManager.Close()
s.StatManager = m
}