diff options
Diffstat (limited to 'db/query.cpp')
-rw-r--r-- | db/query.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/db/query.cpp b/db/query.cpp index 3d251a0..bfe845c 100644 --- a/db/query.cpp +++ b/db/query.cpp @@ -654,11 +654,12 @@ namespace mongo { if ( !ClientCursor::recoverFromYield( _yieldData ) ) { _c.reset(); _cc.reset(); + _so.reset(); massert( 13338, "cursor dropped during query", false ); // TODO maybe we want to prevent recording the winning plan as well? } } - } + } virtual void next() { if ( _findingStartCursor.get() ) { @@ -772,7 +773,8 @@ namespace mongo { _n = _inMemSort ? _so->size() : _n; } else if ( _inMemSort ) { - _so->fill( _buf, _pq.getFields() , _n ); + if( _so.get() ) + _so->fill( _buf, _pq.getFields() , _n ); } if ( _pq.hasOption( QueryOption_CursorTailable ) && _pq.getNumToReturn() != 1 ) |