enumeratePads: fix segfault when no module is loaded in the editor

This commit is contained in:
Tomasz Wlostowski 2015-08-25 10:22:52 +02:00 committed by Maciej Suminski
parent 204eb49ce5
commit 0723ac5bef
1 changed files with 3 additions and 0 deletions

View File

@ -181,6 +181,9 @@ int MODULE_TOOLS::EnumeratePads( const TOOL_EVENT& aEvent )
std::set<D_PAD*> allPads;
MODULE* module = m_board->m_Modules;
if( !module || !module->Pads() )
return 0;
GENERAL_COLLECTOR collector;
const KICAD_T types[] = { PCB_PAD_T, EOT };