Browse Source

DRC dialog: fix a crash when clicking on a item in Footprint Warning panel:

if the warning is a missing footprint, obviously there is no marker associated.
It creates a crash due to a null pointer.

Fixes #4114
https://gitlab.com/kicad/code/kicad/issues/4114
pull/16/head
jean-pierre charras 6 years ago
parent
commit
aebfbda183
  1. 9
      common/rc_item.cpp

9
common/rc_item.cpp

@ -74,7 +74,14 @@ KIID RC_TREE_MODEL::ToUUID( wxDataViewItem aItem )
switch( node->m_Type )
{
case RC_TREE_NODE::MARKER: return rc_item->GetParent()->GetUUID();
case RC_TREE_NODE::MARKER:
// rc_item->GetParent() can be null, if the parent is not existing
// when a RC item has no corresponding ERC/DRC marker
if( rc_item->GetParent() )
return rc_item->GetParent()->GetUUID();
break;
case RC_TREE_NODE::MAIN_ITEM: return rc_item->GetMainItemID();
case RC_TREE_NODE::AUX_ITEM: return rc_item->GetAuxItemID();
}

Loading…
Cancel
Save