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:
parent
3b0ae838fe
commit
88df35654e
@ -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();
|
||||
|
@ -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…
Reference in New Issue
Block a user