summaryrefslogtreecommitdiff
path: root/src/mongo/db/dbhelpers.cpp
diff options
context:
space:
mode:
authorMartin Bligh <mbligh@mongodb.com>2015-10-21 13:25:24 -0400
committerMartin Bligh <mbligh@mongodb.com>2015-10-21 13:26:52 -0400
commita46d64143bae5b1e66b18cb13683d59d8d986e6b (patch)
tree73da57b8ad77f1b466f45e684f1d98fb56636e05 /src/mongo/db/dbhelpers.cpp
parentf7f592e92b3146e20d311a35492116d7488e7e2b (diff)
downloadmongo-a46d64143bae5b1e66b18cb13683d59d8d986e6b.tar.gz
SERVER-21048: Stop regetting the collection in deleteObjects
Diffstat (limited to 'src/mongo/db/dbhelpers.cpp')
-rw-r--r--src/mongo/db/dbhelpers.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mongo/db/dbhelpers.cpp b/src/mongo/db/dbhelpers.cpp
index 8f970c8ca11..999a2c8250e 100644
--- a/src/mongo/db/dbhelpers.cpp
+++ b/src/mongo/db/dbhelpers.cpp
@@ -562,7 +562,8 @@ void Helpers::emptyCollection(OperationContext* txn, const char* ns) {
bool shouldReplicateWrites = txn->writesAreReplicated();
txn->setReplicatedWrites(false);
ON_BLOCK_EXIT(&OperationContext::setReplicatedWrites, txn, shouldReplicateWrites);
- deleteObjects(txn, context.db(), ns, BSONObj(), PlanExecutor::YIELD_MANUAL, false);
+ Collection* collection = context.db() ? context.db()->getCollection(ns) : nullptr;
+ deleteObjects(txn, collection, ns, BSONObj(), PlanExecutor::YIELD_MANUAL, false);
}
Helpers::RemoveSaver::RemoveSaver(const string& a, const string& b, const string& why) {