diff options
Diffstat (limited to 'src/mongo/db/db_raii.cpp')
-rw-r--r-- | src/mongo/db/db_raii.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/mongo/db/db_raii.cpp b/src/mongo/db/db_raii.cpp index 162017fc0f4..8075c940b1a 100644 --- a/src/mongo/db/db_raii.cpp +++ b/src/mongo/db/db_raii.cpp @@ -102,9 +102,7 @@ AutoGetCollectionForRead::AutoGetCollectionForRead(OperationContext* txn, // We have both the DB and collection locked, which is the prerequisite to do a stable shard // version check, but we'd like to do the check after we have a satisfactory snapshot. auto css = CollectionShardingState::get(txn, nss); - if (css) { - css->checkShardVersionOrThrow(txn); - } + css->checkShardVersionOrThrow(txn); } AutoGetCollectionForRead::~AutoGetCollectionForRead() { @@ -196,9 +194,7 @@ void OldClientContext::_checkNotStale() const { break; default: auto css = CollectionShardingState::get(_txn, _ns); - if (css) { - css->checkShardVersionOrThrow(_txn); - } + css->checkShardVersionOrThrow(_txn); } } |