Eeschema: fix crash (null pointer) in Preferences->Colors panel.

When drawing items shown in this panel, the <item>->Schematic() is nullptr
so we cannot use it.
This commit is contained in:
jean-pierre charras 2025-06-19 08:53:13 +02:00
parent 2cd6654e81
commit 92934b2178

View File

@ -1364,7 +1364,10 @@ void SCH_PAINTER::draw( const SCH_LINE* aLine, int aLayer )
bool highlightNetclassColors = false;
double highlightAlpha = 0.6;
EESCHEMA_SETTINGS* eeschemaCfg = eeconfig();
double hopOverScale = aLine->Schematic()->Settings().m_HopOverScale;
double hopOverScale = 0.0;
if( aLine->Schematic() ) // Can be nullptr when run from the color selection panel
aLine->Schematic()->Settings().m_HopOverScale;
if( eeschemaCfg )
{