Guard against dynamic cast failure

This commit is contained in:
Ian McInerney 2020-07-19 01:47:03 +01:00
parent 50b2271f84
commit 967587adcc
1 changed files with 11 additions and 7 deletions

View File

@ -1006,6 +1006,9 @@ bool PANEL_SETUP_BOARD_STACKUP::transferDataFromUIToStackup()
const FAB_LAYER_COLOR* color_list = GetColorStandardList();
wxBitmapComboBox* choice = dynamic_cast<wxBitmapComboBox*>( ui_item.m_ColorCtrl );
if( choice )
{
int idx = choice->GetSelection();
if( idx == GetColorUserDefinedListIdx() )
@ -1017,6 +1020,7 @@ bool PANEL_SETUP_BOARD_STACKUP::transferDataFromUIToStackup()
else
item->SetColor( color_list[idx].m_ColorName );
}
}
row++;
}