summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp
index 3543f4fad7a..39520b31abf 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp
@@ -708,7 +708,9 @@ public:
void detachFromOperationContext() final {
invariant(_txn);
_txn = nullptr;
- _cursor->close(_cursor);
+ if (_cursor) {
+ invariantWTOK(_cursor->close(_cursor));
+ }
_cursor = nullptr;
}
void reattachToOperationContext(OperationContext* txn) final {