summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2013-03-01 14:14:00 -0500
committerMathias Stearn <mathias@10gen.com>2013-03-05 16:30:23 -0500
commit629ed9f2a0bd63fe6640d6497aeee840bd474214 (patch)
treec29897ad6044f504e4b95e75dd29722f8e96b1b2 /src
parent0893701ad4a183589e08d3e00428b6f1d5a37124 (diff)
downloadmongo-629ed9f2a0bd63fe6640d6497aeee840bd474214.tar.gz
SERVER-5826 prevent building an index with a non-existent plugin
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/index.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mongo/db/index.cpp b/src/mongo/db/index.cpp
index cee68107b5d..5077faa1894 100644
--- a/src/mongo/db/index.cpp
+++ b/src/mongo/db/index.cpp
@@ -367,8 +367,13 @@ namespace mongo {
}
string pluginName = IndexPlugin::findPluginName( key );
- IndexPlugin * plugin = pluginName.size() ? IndexPlugin::get( pluginName ) : 0;
-
+ IndexPlugin * plugin = NULL;
+ if (pluginName.size()) {
+ plugin = IndexPlugin::get(pluginName);
+ uassert(16734, str::stream() << "Unknown index plugin '" << pluginName << "' "
+ << "in index "<< key
+ , plugin);
+ }
{
BSONObj o = io;