diff --git a/pcbnew/class_zone.h b/pcbnew/class_zone.h index 7a3fa96984..769ff58dde 100644 --- a/pcbnew/class_zone.h +++ b/pcbnew/class_zone.h @@ -206,8 +206,10 @@ public: int GetSelectedCorner() const { // Transform relative indices to global index - int globalIndex; - m_Poly->GetGlobalIndex( *m_CornerSelection, globalIndex ); + int globalIndex = -1; + + if( m_CornerSelection ) + m_Poly->GetGlobalIndex( *m_CornerSelection, globalIndex ); return globalIndex; }