From 0b754562f6b88725aaca6cfbe33afa3cc3c72db0 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Tue, 9 Apr 2019 05:51:19 -0700 Subject: [PATCH] pcbnew: Handle missing footprint wizards When we do not have any footprint wizards to display, we cannot select the grid rows. Fixes: lp:1823608 * https://bugs.launchpad.net/kicad/+bug/1823608 (cherry picked from commit 7cf394e34fc97cc81a8dacb2077d7ae558f666de) --- pcbnew/dialogs/dialog_footprint_wizard_list.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pcbnew/dialogs/dialog_footprint_wizard_list.cpp b/pcbnew/dialogs/dialog_footprint_wizard_list.cpp index 10bb84debc..bbe91d976f 100644 --- a/pcbnew/dialogs/dialog_footprint_wizard_list.cpp +++ b/pcbnew/dialogs/dialog_footprint_wizard_list.cpp @@ -130,9 +130,11 @@ void DIALOG_FOOTPRINT_WIZARD_LIST::initLists() if ( width > m_footprintGeneratorsGrid->GetColMinimalAcceptableWidth() ) m_footprintGeneratorsGrid->SetColSize( FP_GEN_ROW_DESCR, width ); - // Select the first row + // Select the first row if it exists m_footprintGeneratorsGrid->ClearSelection(); - m_footprintGeneratorsGrid->SelectRow( 0, false ); + + if( m_footprintGeneratorsGrid->GetNumberRows() > 0 ) + m_footprintGeneratorsGrid->SelectRow( 0, false ); // Display info about scripts: Search paths wxString message;