diff options
-rw-r--r-- | src/mongo/db/query/multiple_collection_accessor.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mongo/db/query/multiple_collection_accessor.h b/src/mongo/db/query/multiple_collection_accessor.h index 26fc081000e..bf8c0ad5fe9 100644 --- a/src/mongo/db/query/multiple_collection_accessor.h +++ b/src/mongo/db/query/multiple_collection_accessor.h @@ -60,8 +60,8 @@ public: // Even if the collection corresponding to 'secondaryNss' doesn't exist, we // still want to include it. It is the responsibility of consumers of this class // to verify that a collection exists before accessing it. - _secondaryColls.emplace(std::move(secondaryNss), - catalog->lookupCollectionByNamespace(opCtx, secondaryNss)); + auto collPtr = catalog->lookupCollectionByNamespace(opCtx, secondaryNss); + _secondaryColls.emplace(std::move(secondaryNss), std::move(collPtr)); } } } |