summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2012-06-26 08:34:14 -0400
committerEliot Horowitz <eliot@10gen.com>2012-06-26 08:34:14 -0400
commit63a957eca0eae9fc3e68bf3305bea7cf65b16985 (patch)
tree90ecc77fca0f2d410a2f0ecbc447e659bc86e83c
parent0c6b09490ebdc5900e14d28e0b35ed6e8ec52497 (diff)
downloadmongo-63a957eca0eae9fc3e68bf3305bea7cf65b16985.tar.gz
SREVER-6208 - fix segfault in ttl if collection is dropped
-rw-r--r--src/mongo/db/ttl.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mongo/db/ttl.cpp b/src/mongo/db/ttl.cpp
index 39d904e08ea..4122e46686d 100644
--- a/src/mongo/db/ttl.cpp
+++ b/src/mongo/db/ttl.cpp
@@ -76,6 +76,10 @@ namespace mongo {
string ns = idx["ns"].String();
Client::WriteContext ctx( ns );
NamespaceDetails* nsd = nsdetails( ns.c_str() );
+ if ( ! nsd ) {
+ // collection was dropped
+ continue;
+ }
if ( nsd->setUserFlag( NamespaceDetails::Flag_UsePowerOf2Sizes ) ) {
nsd->syncUserFlags( ns );
}