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:
jean-pierre charras 2023-03-20 16:07:08 +01:00
parent 0d5976c52b
commit 10d4c63c31
1 changed files with 11 additions and 1 deletions

View File

@ -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 )
{