Skip to content

Commit 54296ca

Browse files
committed
fix sf on checking arf existance
1 parent 201e2c8 commit 54296ca

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

argparse.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class ArgumentParser {
120120
for (auto &a : _arguments) {
121121
if (a._required) {
122122
if (_variables.find(a._name) == _variables.end()
123-
&& _variables.find(_pairs.find(a._name)->second) == _variables.end()) {
123+
&& (_pairs.find(a._name) == _pairs.end() || _variables.find(_pairs.find(a._name)->second) == _variables.end())) {
124124
throw ArgumentNotFound(a, _pairs);
125125
}
126126
}

0 commit comments

Comments
 (0)