From 2bc22de1a508b639c25d59f0f0d171c81c466e08 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 11 Mar 2021 08:20:27 +0100 Subject: [PATCH] Eeschema: fix crash when opening preferences, due to null pointer. In panel preview, Schematic() returns a null pointer. Fixes #7869 https://gitlab.com/kicad/code/kicad/issues/7869 --- eeschema/sch_text.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eeschema/sch_text.cpp b/eeschema/sch_text.cpp index ac7fcc25b8..d282686664 100644 --- a/eeschema/sch_text.cpp +++ b/eeschema/sch_text.cpp @@ -1353,7 +1353,8 @@ const EDA_RECT SCH_GLOBALLABEL::GetBoundingBox() const EDA_RECT box( GetBoundingBoxBase() ); - if( Schematic()->Settings().m_IntersheetRefsShow ) + // Note: Schematic() can be null in preference preview panel + if( Schematic() && Schematic()->Settings().m_IntersheetRefsShow ) { box.Merge( m_intersheetRefsField.GetBoundingBox() ); box.Normalize();