Eeschema: fix crash when exporting a netlist, if the schematic netlist cannot be built.

It happens when a symbol is not annotated, and if the user closes the opened annotate dialog without making the annotation
This commit is contained in:
jean-pierre charras 2019-04-13 17:54:15 +02:00
parent dec5d80180
commit 68c2f06074
2 changed files with 8 additions and 2 deletions

View File

@ -599,6 +599,9 @@ void NETLIST_DIALOG::GenNetlist( wxCommandEvent& event )
auto netlist = m_Parent->CreateNetlist( false, false );
if( netlist == nullptr )
wxMessageBox( _( "Schematic netlist not available" ) );
else
m_Parent->WriteNetListFile( netlist, currPage->m_IdNetType,
fullpath, netlist_opt, NULL );

View File

@ -51,6 +51,9 @@ bool SCH_EDIT_FRAME::WriteNetListFile( NETLIST_OBJECT_LIST* aConnectedItemsList,
int aFormat, const wxString& aFullFileName,
unsigned aNetlistOptions, REPORTER* aReporter )
{
if( aConnectedItemsList == nullptr ) // Schematic netlist not available.
return false;
bool res = true;
bool executeCommandLine = false;