Better bounds checking for DIALOG_SIM_MODEL::curModel().
Fixes https://gitlab.com/kicad/code/kicad/issues/13767
This commit is contained in:
parent
56a1cdb4dc
commit
9be872a85a
|
@ -923,8 +923,8 @@ SIM_MODEL& DIALOG_SIM_MODEL<T_symbol, T_field>::curModel() const
|
|||
{
|
||||
int sel = m_modelNameChoice->GetSelection();
|
||||
|
||||
if( sel >= 0 && sel < (int) m_modelNameChoice->GetCount() )
|
||||
return m_libraryModelsMgr.GetModels().at( m_modelNameChoice->GetSelection() ).get();
|
||||
if( sel >= 0 && sel < (int) m_libraryModelsMgr.GetModels().size() )
|
||||
return m_libraryModelsMgr.GetModels().at( sel ).get();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue