Fix a crash after clicking 'delete' button with empty Template Field Names grid
This commit is contained in:
parent
59b0f553e0
commit
6d8ca311f8
|
@ -86,7 +86,7 @@ void PANEL_EESCHEMA_TEMPLATE_FIELDNAMES::OnDeleteButtonClick( wxCommandEvent& ev
|
|||
|
||||
int curRow = m_grid->GetGridCursorRow();
|
||||
|
||||
if( curRow >= 0 )
|
||||
if( curRow >= 0 && curRow < m_fields.size() )
|
||||
{
|
||||
m_fields.erase( m_fields.begin() + curRow );
|
||||
m_grid->DeleteRows( curRow );
|
||||
|
|
Loading…
Reference in New Issue