eeschema: Do not clear highlights with NULL screen

When closing a project, the screen is released, so we need to avoid
cross-probe calls dereferencing the screen pointer.

Fixes: lp:1807501
* https://bugs.launchpad.net/kicad/+bug/1807501
This commit is contained in:
Seth Hillbrand 2018-12-08 07:53:16 -08:00
parent 4fc81bb923
commit fd537c8230
1 changed files with 3 additions and 0 deletions

View File

@ -89,6 +89,9 @@ bool SCH_EDIT_FRAME::SetCurrentSheetHighlightFlags( std::vector<EDA_ITEM*>* aIte
{ {
SCH_SCREEN* screen = m_CurrentSheet->LastScreen(); SCH_SCREEN* screen = m_CurrentSheet->LastScreen();
if( !screen )
return true;
// Disable highlight flag on all items in the current screen // Disable highlight flag on all items in the current screen
for( SCH_ITEM* ptr = screen->GetDrawItems(); ptr; ptr = ptr->Next() ) for( SCH_ITEM* ptr = screen->GetDrawItems(); ptr; ptr = ptr->Next() )
{ {