Fixes segfault in Pcbnew module editor when clicking delete tool where there is no object.

This commit is contained in:
Anton Blanchard 2013-02-22 18:29:44 -05:00 committed by Wayne Stambaugh
parent 348b7de4ab
commit cd664e8b9b
1 changed files with 2 additions and 1 deletions

View File

@ -120,9 +120,10 @@ void FOOTPRINT_EDIT_FRAME::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
case ID_MODEDIT_DELETE_TOOL:
if( ! no_item_edited ) // Item in edit, cannot delete it
break;
item = ModeditLocateAndDisplay();
if( item->Type() != PCB_MODULE_T ) // Cannot delete the module itself
if( item && item->Type() != PCB_MODULE_T ) // Cannot delete the module itself
{
SaveCopyInUndoList( GetBoard()->m_Modules, UR_MODEDIT );
RemoveStruct( item );