mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
check resuming len to avoid panic
This commit is contained in:
parent
6decbe15db
commit
68b1e9f728
@ -581,10 +581,12 @@ func (w *watchGrpcStream) run() {
|
|||||||
switch {
|
switch {
|
||||||
case pbresp.Created:
|
case pbresp.Created:
|
||||||
// response to head of queue creation
|
// response to head of queue creation
|
||||||
if ws := w.resuming[0]; ws != nil {
|
if len(w.resuming) != 0 {
|
||||||
w.addSubstream(pbresp, ws)
|
if ws := w.resuming[0]; ws != nil {
|
||||||
w.dispatchEvent(pbresp)
|
w.addSubstream(pbresp, ws)
|
||||||
w.resuming[0] = nil
|
w.dispatchEvent(pbresp)
|
||||||
|
w.resuming[0] = nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ws := w.nextResume(); ws != nil {
|
if ws := w.nextResume(); ws != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user