Prevent addition of false plot when current plot panel is not in m_plots
Without this commit, when `currentPlotWindow()` returned a valid pointer, but one that is not used as a key in `m_plots`, it would get inserted to the `m_plots` map. Because this pointer was not properly initialized, a crash would later occur. I think this problem was triggered by the pointer to welcome page, but I haven't checked. Fixes https://gitlab.com/kicad/code/kicad/issues/7324
This commit is contained in:
parent
73886aecb1
commit
babda304d9
|
@ -437,7 +437,8 @@ void SIM_PLOT_FRAME::StartSimulation( const wxString& aSimCommand )
|
|||
if( aSimCommand.IsEmpty() )
|
||||
{
|
||||
SIM_PANEL_BASE* plotPanel = currentPlotWindow();
|
||||
if( plotPanel )
|
||||
|
||||
if( plotPanel && m_plots.count( plotPanel ) != 0 )
|
||||
m_exporter->SetSimCommand( m_plots[plotPanel].m_simCommand );
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue