File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -362,16 +362,16 @@ class Result implements Iterator<DBObject> {
362362 }
363363
364364 private void init ( Response res ){
365+ if ( ( res ._flags & Bytes .RESULTFLAG_CURSORNOTFOUND ) > 0 ){
366+ throw new MongoException .CursorNotFound (_curResult .cursor (), res .serverUsed ());
367+ }
368+
365369 _totalBytes += res ._len ;
366370 _curResult = res ;
367371 _cur = res .iterator ();
368372 _sizes .add ( res .size () );
369373 _numFetched += res .size ();
370374
371- if ( ( res ._flags & Bytes .RESULTFLAG_CURSORNOTFOUND ) > 0 ){
372- throw new MongoException .CursorNotFound (res ._cursor , res .serverUsed ());
373- }
374-
375375 if (res ._cursor != 0 && _limit > 0 && _limit - _numFetched <= 0 ) {
376376 // fetched all docs within limit, close cursor server-side
377377 killCursor ();
You can’t perform that action at this time.
0 commit comments