Browse Source

Prevent attempt at plotting invalid sheets

If the number does not exist in the schematic, don't attempt plotting

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19039
pcb_db
Seth Hillbrand 1 year ago
parent
commit
88df35654e
  1. 4
      common/plotters/PDF_plotter.cpp
  2. 8
      eeschema/sch_plotter.cpp

4
common/plotters/PDF_plotter.cpp

@ -1110,7 +1110,9 @@ int PDF_PLOTTER::emitOutline()
bool PDF_PLOTTER::EndPlot()
{
wxASSERT( m_outputFile );
// We can end up here if there was nothing to plot
if( !m_outputFile )
return false;
// Close the current page (often the only one)
ClosePage();

8
eeschema/sch_plotter.cpp

@ -134,6 +134,14 @@ void SCH_PLOTTER::createPDFFile( const SCH_PLOT_OPTS& aPlotOpts,
sheetList.push_back( m_schematic->CurrentSheet() );
}
if( sheetList.empty() )
{
if( aReporter )
aReporter->Report( _( "No sheets to plot." ), RPT_SEVERITY_ERROR );
return;
}
wxCHECK( m_schematic, /* void */ );
// Allocate the plotter and set the job level parameter

Loading…
Cancel
Save