We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2db6676 commit f7ec61bCopy full SHA for f7ec61b
src/mongo/client/dbclient.cpp
@@ -319,7 +319,10 @@ namespace mongo {
319
boost::algorithm::split(
320
optionsTokens, optionsMatch, boost::algorithm::is_any_of("=&"));
321
322
- invariant(optionsTokens.size() % 2 == 0);
+ if (optionsTokens.size() % 2 != 0) {
323
+ errmsg = "Missing a key or value in the options for mongodb:// URL: " + url;
324
+ return ConnectionString();
325
+ }
326
327
for (size_t i = 0; i != optionsTokens.size(); i = i + 2)
328
options[std::string(optionsTokens[i].begin(), optionsTokens[i].end())] =
0 commit comments