Skip to content

Commit

Permalink
fix uncaught stoi exception
Browse files Browse the repository at this point in the history
(cherry-picked from commit e88a73f)
  • Loading branch information
gfgtdf committed Oct 7, 2018
1 parent 959f676 commit 88db848
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/units/filter.cpp
Expand Up @@ -39,6 +39,7 @@

static lg::log_domain log_config("config");
#define ERR_CF LOG_STREAM(err, log_config)
#define WRN_CF LOG_STREAM(warn, log_config)
#define DBG_CF LOG_STREAM(debug, log_config)

using namespace unit_filter_impl;
Expand Down Expand Up @@ -440,7 +441,11 @@ void unit_filter_compound::fill(vconfig cfg)
{
std::vector<int> res;
for(const std::string& s : utils::split(c.str())) {
res.push_back(std::stoi(s));
try {
res.push_back(std::stoi(s));
} catch(std::invalid_argument&) {
WRN_CF << "ignored invalid side='" << s << "' in filter\n";
}
}
return res;
},
Expand Down

0 comments on commit 88db848

Please sign in to comment.