Use resolved path when trying to load sheet content.

Also, if it can't be loaded then at least initialize it so that we
don't crash later (trying to access a NULL screen).

Fixes: lp:1841801
* https://bugs.launchpad.net/kicad/+bug/1841801
This commit is contained in:
Jeff Young 2019-08-29 23:25:52 +01:00
parent d2cd659471
commit 02a7a79e0d
1 changed files with 2 additions and 1 deletions

View File

@ -1051,7 +1051,8 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent )
}
else
{
m_frame->LoadSheetFromFile( sheet, g_CurrentSheet, sheet->GetFileName() );
if( !m_frame->LoadSheetFromFile( sheet, g_CurrentSheet, fn.GetFullPath() ) )
m_frame->InitSheet( sheet, sheet->GetFileName() );
}
}