diff --git a/eeschema/dialogs/dialog_netlist.cpp b/eeschema/dialogs/dialog_netlist.cpp index 0f0ea24fd8..61a4cf3333 100644 --- a/eeschema/dialogs/dialog_netlist.cpp +++ b/eeschema/dialogs/dialog_netlist.cpp @@ -599,8 +599,11 @@ void NETLIST_DIALOG::GenNetlist( wxCommandEvent& event ) auto netlist = m_Parent->CreateNetlist( false, false ); - m_Parent->WriteNetListFile( netlist, currPage->m_IdNetType, - fullpath, netlist_opt, NULL ); + if( netlist == nullptr ) + wxMessageBox( _( "Schematic netlist not available" ) ); + else + m_Parent->WriteNetListFile( netlist, currPage->m_IdNetType, + fullpath, netlist_opt, NULL ); WriteCurrentNetlistSetup(); diff --git a/eeschema/netlist_generator.cpp b/eeschema/netlist_generator.cpp index 6f5979b3e0..a4eb130044 100644 --- a/eeschema/netlist_generator.cpp +++ b/eeschema/netlist_generator.cpp @@ -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;