Do not crash if PARAM_LIST backing data contains unexpected type
This commit is contained in:
parent
b8a61719c3
commit
1a8fcdfdd7
|
@ -121,7 +121,16 @@ bool PARAM_LIST<ValueType>::MatchesFile( JSON_SETTINGS* aSettings ) const
|
|||
std::vector<ValueType> val;
|
||||
|
||||
for( const auto& el : js->items() )
|
||||
{
|
||||
try
|
||||
{
|
||||
val.emplace_back( el.value().get<ValueType>() );
|
||||
}
|
||||
catch( ... )
|
||||
{
|
||||
// Probably typecast didn't work; skip this element
|
||||
}
|
||||
}
|
||||
|
||||
return val == *m_ptr;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue