check resuming len to avoid panic

release-3.5
yangxuanjia 2021-05-08 09:47:13 +08:00
parent 6decbe15db
commit 68b1e9f728
1 changed files with 6 additions and 4 deletions

View File

@ -581,10 +581,12 @@ func (w *watchGrpcStream) run() {
switch {
case pbresp.Created:
// response to head of queue creation
if ws := w.resuming[0]; ws != nil {
w.addSubstream(pbresp, ws)
w.dispatchEvent(pbresp)
w.resuming[0] = nil
if len(w.resuming) != 0 {
if ws := w.resuming[0]; ws != nil {
w.addSubstream(pbresp, ws)
w.dispatchEvent(pbresp)
w.resuming[0] = nil
}
}
if ws := w.nextResume(); ws != nil {