SCH_FIELD::Plot(): better test before trying to plot inter-sheet refs

inter-sheet refs exist only for global labels. It avoid an assert in debug mode.
This commit is contained in:
jean-pierre charras
2025-05-02 11:13:11 +02:00
parent 7498f1b1a6
commit 32048d3b1e
+2 -1
View File
@@ -1540,7 +1540,8 @@ void SCH_FIELD::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS&
aPlotter->PlotText( textpos, color, text, attrs, font, GetFontMetrics() );
if( m_id == INTERSHEET_REFS && Schematic() )
// Plot intersheet refs (only global labels have them)
if( m_parent && m_parent->Type() == SCH_GLOBAL_LABEL_T && m_id == INTERSHEET_REFS && Schematic() )
{
SCH_LABEL_BASE* label = dynamic_cast<SCH_LABEL_BASE*>( m_parent );
std::vector<std::pair<wxString, wxString>> pages;