DATAMONGO-1725 - Prevent NullPointerException in CloseableIterableCursorAdapter.close().
This commit is contained in:
@@ -2740,8 +2740,13 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware,
|
|||||||
public void close() {
|
public void close() {
|
||||||
|
|
||||||
MongoCursor<Document> c = cursor;
|
MongoCursor<Document> c = cursor;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
c.close();
|
|
||||||
|
if (c != null) {
|
||||||
|
c.close();
|
||||||
|
}
|
||||||
|
|
||||||
} catch (RuntimeException ex) {
|
} catch (RuntimeException ex) {
|
||||||
throw potentiallyConvertRuntimeException(ex, exceptionTranslator);
|
throw potentiallyConvertRuntimeException(ex, exceptionTranslator);
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
Reference in New Issue
Block a user