Browse Source

store: check remove func before call it

Xiang Li 11 years ago
parent
commit
b951aaf925
1 changed files with 3 additions and 1 deletions
  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()
+	}
 }
 }