diff --git a/eeschema/erc.cpp b/eeschema/erc.cpp index 8defe81daa..6549967455 100644 --- a/eeschema/erc.cpp +++ b/eeschema/erc.cpp @@ -157,6 +157,12 @@ void ERC_TESTER::TestTextVars( KIGFX::WS_PROXY_VIEW_ITEM* aWorksheet ) if( aWorksheet ) { wsItems.SetMilsToIUfactor( IU_PER_MILS ); + wsItems.SetSheetNumber( 1 ); + wsItems.SetSheetCount( 1 ); + wsItems.SetFileName( "dummyFilename" ); + wsItems.SetSheetName( "dummySheet" ); + wsItems.SetSheetLayer( "dummyLayer" ); + wsItems.SetProject( &m_schematic->Prj() ); wsItems.BuildWorkSheetGraphicList( aWorksheet->GetPageInfo(), aWorksheet->GetTitleBlock() ); } diff --git a/pcbnew/dialogs/dialog_drc.cpp b/pcbnew/dialogs/dialog_drc.cpp index 9faa7767f3..d13e43f982 100644 --- a/pcbnew/dialogs/dialog_drc.cpp +++ b/pcbnew/dialogs/dialog_drc.cpp @@ -250,7 +250,10 @@ void DIALOG_DRC::OnDRCItemSelected( wxDataViewEvent& aEvent ) BOARD_ITEM* c = board->GetItem( rc_item->GetAuxItem2ID() ); BOARD_ITEM* d = board->GetItem( rc_item->GetAuxItem3ID() ); - LSET violationLayers = a->GetLayerSet(); + LSET violationLayers; + + if( a ) + violationLayers &= a->GetLayerSet(); if( b ) violationLayers &= b->GetLayerSet();