소스 검색

store: check remove func before call it

Xiang Li 11 년 전
부모
커밋
b951aaf925
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      store/watcher.go

+ 3 - 1
store/watcher.go

@@ -68,5 +68,7 @@ func (w *Watcher) Remove() {
 	defer w.hub.mutex.Unlock()
 	defer w.hub.mutex.Unlock()
 
 
 	close(w.EventChan)
 	close(w.EventChan)
-	w.remove()
+	if w.remove != nil {
+		w.remove()
+	}
 }
 }