diff --git a/eeschema/sim/sim_plot_frame.cpp b/eeschema/sim/sim_plot_frame.cpp index 0561a1e9d6..8fbc3c8a64 100644 --- a/eeschema/sim/sim_plot_frame.cpp +++ b/eeschema/sim/sim_plot_frame.cpp @@ -501,14 +501,14 @@ void SIM_PLOT_FRAME::onSimFinished( wxCommandEvent& aEvent ) m_signals->Append( net.first ); } + SIM_PLOT_PANEL* plotPanel = CurrentPlot(); + + if( plotPanel == nullptr || plotPanel->GetType() != simType ) + return; + // If there are any signals plotted, update them if( SIM_PLOT_PANEL::IsPlottable( simType ) ) { - SIM_PLOT_PANEL* plotPanel = CurrentPlot(); - - if( plotPanel == nullptr ) - return; - for( const auto& trace : plotPanel->GetTraces() ) updatePlot( trace.second->GetSpiceName(), trace.second->GetName(), plotPanel );