libedit: Don't move the field below the last item

There needs to be at least one item below the one we want to move down
in order to allow the action.

Fixes: lp:1820532
* https://bugs.launchpad.net/kicad/+bug/1820532
This commit is contained in:
Seth Hillbrand 2019-03-17 20:19:21 -07:00
parent d6f565e452
commit 0943c176a3
1 changed files with 1 additions and 1 deletions

View File

@ -480,7 +480,7 @@ void DIALOG_EDIT_COMPONENT_IN_LIBRARY::OnMoveDown( wxCommandEvent& event )
int i = m_grid->GetGridCursorRow();
if( i >= MANDATORY_FIELDS )
if( i >= MANDATORY_FIELDS && i + 1 < m_fields->GetNumberRows() )
{
LIB_FIELD tmp = m_fields->at( (unsigned) i );
m_fields->erase( m_fields->begin() + i, m_fields->begin() + i + 1 );