7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-21 08:51:42 +00:00

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
This commit is contained in:
Seth Hillbrand 2024-11-01 10:55:03 -07:00
parent 3b0ae838fe
commit 88df35654e
2 changed files with 11 additions and 1 deletions
common/plotters
eeschema

View File

@ -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();

View File

@ -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