Catch all exceptions thrown by std::stoi()
This commit is contained in:
@@ -50,10 +50,12 @@ const YamlLookupTable sliderConfigLut = {
|
||||
|
||||
int YamlStickLookup::name2idx(const std::string& name)
|
||||
{
|
||||
int idx = std::stoi(name);
|
||||
if (idx < 4) {
|
||||
return idx;
|
||||
}
|
||||
try {
|
||||
int idx = std::stoi(name);
|
||||
if (idx < 4) {
|
||||
return idx;
|
||||
}
|
||||
} catch(...) {}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user