Fix a search pane crash when a row isn't in the hit list.
Fixes KICAD-Q7 Fixes KICAD-1A6
This commit is contained in:
parent
0fcf9e2c7d
commit
f071dd1406
|
@ -48,7 +48,15 @@ public:
|
||||||
|
|
||||||
wxString GetResultCell( int aRow, int aCol ) override
|
wxString GetResultCell( int aRow, int aCol ) override
|
||||||
{
|
{
|
||||||
return getResultCell( m_hitlist[aRow], aCol );
|
if( aRow >= m_hitlist.size() )
|
||||||
|
return wxEmptyString;
|
||||||
|
|
||||||
|
const SCH_SEARCH_HIT& hit = m_hitlist[aRow];
|
||||||
|
|
||||||
|
if( !hit.item )
|
||||||
|
return wxEmptyString;
|
||||||
|
|
||||||
|
return getResultCell( hit, aCol );
|
||||||
}
|
}
|
||||||
|
|
||||||
void FindAll( const std::function<bool( SCH_ITEM*, SCH_SHEET_PATH* )>& aCollector );
|
void FindAll( const std::function<bool( SCH_ITEM*, SCH_SHEET_PATH* )>& aCollector );
|
||||||
|
|
|
@ -39,7 +39,15 @@ public:
|
||||||
|
|
||||||
wxString GetResultCell( int aRow, int aCol ) override
|
wxString GetResultCell( int aRow, int aCol ) override
|
||||||
{
|
{
|
||||||
return getResultCell( m_hitlist[aRow], aCol );
|
if( aRow >= m_hitlist.size() )
|
||||||
|
return wxEmptyString;
|
||||||
|
|
||||||
|
BOARD_ITEM* item = m_hitlist[aRow];
|
||||||
|
|
||||||
|
if( !item )
|
||||||
|
return wxEmptyString;
|
||||||
|
|
||||||
|
return getResultCell( item, aCol );
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sort( int aCol, bool aAscending ) override;
|
void Sort( int aCol, bool aAscending ) override;
|
||||||
|
|
Loading…
Reference in New Issue