File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
test/functional/com/mongodb Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -576,7 +576,7 @@ public DBCursor skip(final int numberOfElements) {
576
576
577
577
@ Override
578
578
public long getCursorId () {
579
- if (cursor != null ) {
579
+ if (cursor != null && cursor . getServerCursor () != null ) {
580
580
return cursor .getServerCursor ().getId ();
581
581
} else {
582
582
return 0 ;
Original file line number Diff line number Diff line change @@ -210,6 +210,11 @@ public void testGetCursorId() {
210
210
assertEquals (0 , cursor .getCursorId ());
211
211
cursor .hasNext ();
212
212
assertThat (cursor .getCursorId (), is (not (0L )));
213
+
214
+ cursor = collection .find ();
215
+ assertEquals (0 , cursor .getCursorId ());
216
+ cursor .hasNext ();
217
+ assertThat (cursor .getCursorId (), is (0L ));
213
218
}
214
219
215
220
@ Test
You can’t perform that action at this time.
0 commit comments