eeschema: Load using root sheet if null

The root sheet is not set for pasting, in which case, we should utilize
the global root if needed.

Fixes #3956 | https://gitlab.com/kicad/code/kicad/issues/3956
This commit is contained in:
Seth Hillbrand 2020-02-28 11:08:48 -08:00
parent 72a6963e9e
commit 081ec393da
1 changed files with 5 additions and 0 deletions

View File

@ -754,6 +754,11 @@ void SCH_LEGACY_PLUGIN::LoadContent( LINE_READER& aReader, SCH_SCREEN* aScreen,
{
m_version = version;
// We cannot safely load content without a set root level. If we haven't been given one,
// pick the default
if( m_rootSheet == nullptr )
m_rootSheet = g_RootSheet;
while( aReader.ReadLine() )
{
char* line = aReader.Line();