diff options
-rw-r--r-- | src/mongo/db/catalog/collection.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mongo/db/catalog/collection.cpp b/src/mongo/db/catalog/collection.cpp index a2a8b0ecbc8..c680ce41b79 100644 --- a/src/mongo/db/catalog/collection.cpp +++ b/src/mongo/db/catalog/collection.cpp @@ -709,7 +709,11 @@ StatusWith<RecordId> Collection::_updateDocumentWithMove(OperationContext* txn, invariant(sid == txn->recoveryUnit()->getSnapshotId()); args->updatedDoc = newDoc; - txn->getServiceContext()->getOpObserver()->onUpdate(txn, *args); + + auto opObserver = getGlobalServiceContext()->getOpObserver(); + if (opObserver) { + opObserver->onUpdate(txn, *args); + } moveCounter.increment(); if (opDebug) { |