diff options
author | Antonio Fuschetto <antonio.fuschetto@mongodb.com> | 2023-03-29 19:21:03 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-03-29 21:40:22 +0000 |
commit | cd6a60a933265227d24381543e8de79a3220e757 (patch) | |
tree | b50f45d73cebc2a19efac085171bb8bf4d221417 /src | |
parent | b3a2dbe8f874b28c0cb31fd03d573655df55be61 (diff) | |
download | mongo-cd6a60a933265227d24381543e8de79a3220e757.tar.gz |
SERVER-75021 Coverity analysis defect 135525: Dereference null return value
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/db/s/shardsvr_check_metadata_consistency_participant_command.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mongo/db/s/shardsvr_check_metadata_consistency_participant_command.cpp b/src/mongo/db/s/shardsvr_check_metadata_consistency_participant_command.cpp index a75b1415404..45930e88948 100644 --- a/src/mongo/db/s/shardsvr_check_metadata_consistency_participant_command.cpp +++ b/src/mongo/db/s/shardsvr_check_metadata_consistency_participant_command.cpp @@ -102,10 +102,11 @@ public: for (auto it = collCatalogSnapshot->begin(opCtx, nss.dbName()); it != collCatalogSnapshot->end(opCtx); ++it) { - if (!(*it)->ns().isNormalCollection()) { + const auto coll = *it; + if (!coll || !coll->ns().isNormalCollection()) { continue; } - localCollections.emplace_back(CollectionPtr(*it)); + localCollections.emplace_back(CollectionPtr(coll)); } std::sort(localCollections.begin(), localCollections.end(), |