diff --git a/eeschema/tools/sch_editor_control.cpp b/eeschema/tools/sch_editor_control.cpp index ab4a1f3022..a4869c7b21 100644 --- a/eeschema/tools/sch_editor_control.cpp +++ b/eeschema/tools/sch_editor_control.cpp @@ -538,18 +538,17 @@ int SCH_EDITOR_CONTROL::FindNext( const TOOL_EVENT& aEvent ) continue; } - SCH_SCREEN* screen = sheet->LastScreen(); + sheet->UpdateAllScreenReferences(); - item = nextMatch( screen, sheet, nullptr, data ); + item = nextMatch( sheet->LastScreen(), sheet, nullptr, data ); if( item ) { m_frame->Schematic().SetCurrentSheet( *sheet ); - m_frame->GetCurrentSheet().UpdateAllScreenReferences(); - screen->TestDanglingEnds(); + sheet->LastScreen()->TestDanglingEnds(); - m_frame->SetScreen( screen ); + m_frame->SetScreen( sheet->LastScreen() ); m_frame->UpdateHierarchyNavigator(); UpdateFind( ACTIONS::updateFind.MakeEvent() );