From 4d3054599b888f9f588d8191fcb10951ce1c4d58 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 1 Feb 2017 13:02:08 +0100 Subject: [PATCH] Fix a warning in Debug build on Linux, when there is no wizard loaded. --- pcbnew/dialogs/dialog_footprint_wizard_list.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pcbnew/dialogs/dialog_footprint_wizard_list.cpp b/pcbnew/dialogs/dialog_footprint_wizard_list.cpp index 0a342c8893..1e32a827d8 100644 --- a/pcbnew/dialogs/dialog_footprint_wizard_list.cpp +++ b/pcbnew/dialogs/dialog_footprint_wizard_list.cpp @@ -101,8 +101,12 @@ void DIALOG_FOOTPRINT_WIZARD_LIST::initLists() m_footprintGeneratorsGrid->SetSelectionMode( wxGrid::wxGridSelectRows ); int curr_row_cnt = m_footprintGeneratorsGrid->GetNumberRows(); - m_footprintGeneratorsGrid->DeleteRows( 0, curr_row_cnt ); - m_footprintGeneratorsGrid->InsertRows( 0, n_wizards ); + + if( curr_row_cnt ) + m_footprintGeneratorsGrid->DeleteRows( 0, curr_row_cnt ); + + if( n_wizards ) + m_footprintGeneratorsGrid->InsertRows( 0, n_wizards ); // Put all wizards in the list for( int ii = 0; ii < n_wizards; ii++ ) @@ -139,6 +143,7 @@ void DIALOG_FOOTPRINT_WIZARD_LIST::initLists() m_tcSearchPaths->SetValue( message ); // Display info about scripts: unloadable scripts (due to syntax errors is python source) pcbnewGetUnloadableScriptNames( message ); + if( message.IsEmpty() ) { m_tcNotLoaded->SetValue( _( "All footprint generator scripts were loaded" ) );