From 1112d279c5a90bd57a48605aecfee6feb1f08f0a Mon Sep 17 00:00:00 2001 From: "tomasz.wlostowski@cern.ch" Date: Wed, 18 Sep 2013 13:16:57 +0200 Subject: [PATCH] PCB_PAINTER: fix segfault when item has no net assigned --- pcbnew/pcb_painter.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index 6810f5049f..3889963c3e 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -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 );