From da17437490817f0c1ad5ecbd06770a6e40a19cf9 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Tue, 25 Aug 2020 13:26:20 -0400 Subject: [PATCH] Don't crash when trying to draw a no connect with no parent schematic --- eeschema/sch_no_connect.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eeschema/sch_no_connect.cpp b/eeschema/sch_no_connect.cpp index 0d41ef5aa4..da61affa9f 100644 --- a/eeschema/sch_no_connect.cpp +++ b/eeschema/sch_no_connect.cpp @@ -97,6 +97,9 @@ void SCH_NO_CONNECT::GetEndPoints( std::vector< DANGLING_END_ITEM >& aItemList ) int SCH_NO_CONNECT::GetPenWidth() const { + if( !Schematic() ) + return 1; + return std::max( Schematic()->Settings().m_DefaultLineWidth, 1 ); }