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:
parent
72a6963e9e
commit
081ec393da
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue