add nil check

pull/1013/head
wuxiang 2018-04-03 17:40:21 +08:00
parent 3f19d09878
commit 4bed69a9b9
1 changed files with 3 additions and 1 deletions

View File

@ -70,6 +70,8 @@ func (s *syncStatManager) Set(m StatManager) {
s.Lock()
defer s.Unlock()
s.StatManager.Close()
if s.StatManager != nil {
s.StatManager.Close()
}
s.StatManager = m
}