Skip to content

Commit

Permalink
backend etcd: avoid nil response by checking etcd error
Browse files Browse the repository at this point in the history
  • Loading branch information
kelseyhightower committed Oct 26, 2014
1 parent 0d1283f commit b461108
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backends/etcd/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,8 @@ func (c *Client) WatchPrefix(prefix string, waitIndex uint64, stopChan chan bool
return resp.EtcdIndex, nil
}
resp, err := c.client.Watch(prefix, waitIndex+1, true, nil, stopChan)
if err != nil {
return waitIndex, err
}
return resp.Node.ModifiedIndex, err
}

0 comments on commit b461108

Please sign in to comment.