Commit 1112d279 authored by tomasz.wlostowski@cern.ch's avatar tomasz.wlostowski@cern.ch
Browse files

PCB_PAINTER: fix segfault when item has no net assigned

parent 88ee2884
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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 );