Coverity fixes.

CIDs 309391, 310711, 310712, and 313055.
This commit is contained in:
Wayne Stambaugh 2020-11-12 08:15:49 -05:00
parent 731e56a474
commit 43a4cf7957
3 changed files with 9 additions and 1 deletions

View File

@ -1289,6 +1289,8 @@ int SCH_EDIT_FRAME::RecomputeIntersheetsRefs()
else
{
iref = gLabel->GetIref();
wxCHECK2( iref, continue );
}
iref->GetRefTable().clear();
@ -1320,6 +1322,8 @@ int SCH_EDIT_FRAME::RecomputeIntersheetsRefs()
iref = item->GetIref();
wxCHECK2( iref, continue );
std::sort( iref->GetRefTable().begin(), iref->GetRefTable().end() );
iref->GetRefTable().erase( std::unique( iref->GetRefTable().begin(),
iref->GetRefTable().end() ),

View File

@ -800,6 +800,7 @@ protected:
DIALOG_NET_INSPECTOR::DIALOG_NET_INSPECTOR( PCB_EDIT_FRAME* aParent,
const SETTINGS& aSettings ) :
DIALOG_NET_INSPECTOR_BASE( aParent ),
m_zero_netitem( nullptr ),
m_frame( aParent )
{
m_brd = aParent->GetBoard();

View File

@ -106,7 +106,10 @@ void GRID_CELL_LAYER_SELECTOR::Create( wxWindow* aParent, wxWindowID aId,
wxString GRID_CELL_LAYER_SELECTOR::GetValue() const
{
return m_frame->GetBoard()->GetLayerName( ToLAYER_ID( LayerBox()->GetLayerSelection() ) );
if( LayerBox()->GetLayerSelection() != UNDEFINED_LAYER )
return m_frame->GetBoard()->GetLayerName( ToLAYER_ID( LayerBox()->GetLayerSelection() ) );
return wxEmptyString;
}