From 6d8ca311f81bca068f326f4112a22dec96dad3b9 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Thu, 29 Nov 2018 14:09:07 +0100 Subject: [PATCH] Fix a crash after clicking 'delete' button with empty Template Field Names grid --- eeschema/dialogs/panel_eeschema_template_fieldnames.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eeschema/dialogs/panel_eeschema_template_fieldnames.cpp b/eeschema/dialogs/panel_eeschema_template_fieldnames.cpp index f27a775d8e..168a1a5247 100644 --- a/eeschema/dialogs/panel_eeschema_template_fieldnames.cpp +++ b/eeschema/dialogs/panel_eeschema_template_fieldnames.cpp @@ -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 );