PCB_PAINTER: fix segfault when item has no net assigned

This commit is contained in:
tomasz.wlostowski@cern.ch 2013-09-18 13:16:57 +02:00
parent 88ee288465
commit 1112d279c5
1 changed files with 3 additions and 0 deletions

View File

@ -283,6 +283,9 @@ void PCB_PAINTER::draw( const TRACK* aTrack, int aLayer )
return;
NETINFO_ITEM* net = ( (BOARD*) aTrack->GetParent() )->FindNet( netNumber );
if(!net)
return;
std::string netName = std::string( net->GetShortNetname().mb_str() );
VECTOR2D textPosition = start + line / 2.0; // center of the track
double textOrientation = -atan( line.y / line.x );