1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #676 from sanimej/bfix

Fix the daemon panic on consul server restart
This commit is contained in:
Madhu Venugopal 2015-10-20 00:18:42 +02:00
commit d8e14c9efc

View file

@ -265,6 +265,13 @@ func (ds *datastore) Watch(kvObject KVObject, stopCh <-chan struct{}) (<-chan KV
close(sCh)
return
case kvPair := <-kvpCh:
// If the backend KV store gets reset libkv's go routine
// for the watch can exit resulting in a nil value in
// channel.
if kvPair == nil {
close(sCh)
return
}
dstO := ctor.New()
if err := dstO.SetValue(kvPair.Value); err != nil {