summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mongo/util/options_parser/environment.cpp3
-rw-r--r--src/mongo/util/options_parser/option_section.cpp3
2 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/util/options_parser/environment.cpp b/src/mongo/util/options_parser/environment.cpp
index 08f68009da1..e6deb38cf1b 100644
--- a/src/mongo/util/options_parser/environment.cpp
+++ b/src/mongo/util/options_parser/environment.cpp
@@ -211,6 +211,9 @@ bool Environment::count(const Key& key) const {
Value Environment::operator[](const Key& key) const {
Value value;
Status ret = get(key, &value);
+ if (!ret.isOK()) {
+ return Value();
+ }
return value;
}
diff --git a/src/mongo/util/options_parser/option_section.cpp b/src/mongo/util/options_parser/option_section.cpp
index 4e23b7b3ee9..21db4e5aa8a 100644
--- a/src/mongo/util/options_parser/option_section.cpp
+++ b/src/mongo/util/options_parser/option_section.cpp
@@ -380,6 +380,9 @@ Status OptionSection::getBoostOptions(po::options_description* boostOptions,
includeDefaults ? oditerator->_default : Value(),
oditerator->_implicit,
!(sources & SourceCommandLine));
+ if (!retDep.isOK()) {
+ return retDep;
+ }
boostOptions->add_options()(depreatedSingleName.c_str(),
boostTypeDep.release(),
oditerator->_description.c_str());