Explorar el Código

store: check remove func before call it

Xiang Li hace 11 años
padre
commit
b951aaf925
Se han modificado 1 ficheros con 3 adiciones y 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()
+	}
 }