Explorar o código

store: check remove func before call it

Xiang Li %!s(int64=12) %!d(string=hai) anos
pai
achega
b951aaf925
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      store/watcher.go

+ 3 - 1
store/watcher.go

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