Fix crash in ScriptFrame::AddImport

refs #12408
This commit is contained in:
Gunnar Beutner 2016-08-12 15:20:41 +02:00
parent 3454cf88a7
commit 491acb62ea
1 changed files with 8 additions and 1 deletions

View File

@ -120,8 +120,15 @@ Array::Ptr ScriptFrame::GetImports(void)
void ScriptFrame::AddImport(const Object::Ptr& import)
{
Array::Ptr imports = m_Imports->ShallowClone();
Array::Ptr imports;
if (!m_Imports)
imports = new Array();
else
imports = m_Imports->ShallowClone();
imports->Add(import);
m_Imports = imports;
}