Skip to content

Commit 808a30b

Browse files
committed
Fixed bug with seekCursor
1 parent b8e7cb9 commit 808a30b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cursor.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ func (c *Cursor) seekCursor(bufferResponse bool) error {
519519
return c.lastErr
520520
}
521521

522-
if len(c.responses) == 0 && c.closed {
522+
if len(c.buffer) == 0 && len(c.responses) == 0 && c.closed {
523523
return errCursorClosed
524524
}
525525

@@ -534,7 +534,7 @@ func (c *Cursor) seekCursor(bufferResponse bool) error {
534534
return err
535535
}
536536
continue // go around the loop again to re-apply pending skips
537-
} else if len(c.responses) == 0 && !c.finished && !c.closed {
537+
} else if len(c.buffer) == 0 && len(c.responses) == 0 && !c.finished && !c.closed {
538538
// We skipped all of our data, load some more
539539
if err := c.fetchMore(); err != nil {
540540
return err

0 commit comments

Comments
 (0)