EDA_SHAPE_DESC(): catch a std::runtime_error when emitted by
template<typename T> T Get( PROPERTY_BASE* aProperty ) to avoid a crash, and displays in Debug mode the runtime error message. Fixes #14347 https://gitlab.com/kicad/code/kicad/issues/14347
This commit is contained in:
parent
0d5976c52b
commit
10d4c63c31
|
@ -1736,7 +1736,17 @@ static struct EDA_SHAPE_DESC
|
|||
filled->SetAvailableFunc(
|
||||
[=]( INSPECTABLE* aItem ) -> bool
|
||||
{
|
||||
SHAPE_T itemShape = aItem->Get<SHAPE_T>( shape );
|
||||
SHAPE_T itemShape;
|
||||
|
||||
try
|
||||
{
|
||||
itemShape = aItem->Get<SHAPE_T>( shape );
|
||||
}
|
||||
catch( std::runtime_error& err )
|
||||
{
|
||||
wxFAIL_MSG( err.what() );
|
||||
return false;
|
||||
}
|
||||
|
||||
switch( itemShape )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue