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
This commit is contained in:
jean-pierre charras 2021-03-11 08:20:27 +01:00
parent db1f457ff9
commit 2bc22de1a5
1 changed files with 2 additions and 1 deletions

View File

@ -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();