Eeschema: Check for NULL pointer when using interactive delete tool
CHANGED: If you start the interactive delete tool and the mouse pointer isn't near anything, Eeschema tries to use a null EDA_ITEM pointer which throws an exception. This commit checks if the pointer is null and exits if it is.
This commit is contained in:
parent
e7c31f5dba
commit
b0e05ad9bf
|
@ -726,12 +726,14 @@ void EE_SELECTION_TOOL::GuessSelectionCandidates( EE_COLLECTOR& collector, const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( closest ) // Don't try and get a tight bbox if nothing is near the mouse pointer
|
||||||
|
{
|
||||||
EDA_RECT tightBox = closest->GetBoundingBox();
|
EDA_RECT tightBox = closest->GetBoundingBox();
|
||||||
tightBox.Inflate( -tightBox.GetWidth() / 4, -tightBox.GetHeight() / 4 );
|
tightBox.Inflate( -tightBox.GetWidth() / 4, -tightBox.GetHeight() / 4 );
|
||||||
|
|
||||||
for( int i = collector.GetCount() - 1; i >= 0; --i )
|
for( int i = collector.GetCount() - 1; i >= 0; --i )
|
||||||
{
|
{
|
||||||
EDA_ITEM* item = collector[ i ];
|
EDA_ITEM* item = collector[i];
|
||||||
|
|
||||||
if( item == closest )
|
if( item == closest )
|
||||||
continue;
|
continue;
|
||||||
|
@ -739,6 +741,7 @@ void EE_SELECTION_TOOL::GuessSelectionCandidates( EE_COLLECTOR& collector, const
|
||||||
if( !item->HitTest( tightBox, true ) )
|
if( !item->HitTest( tightBox, true ) )
|
||||||
collector.Transfer( item );
|
collector.Transfer( item );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue