From 491acb62eae721179befb4e5f82042db86c2fe47 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Fri, 12 Aug 2016 15:20:41 +0200 Subject: [PATCH] Fix crash in ScriptFrame::AddImport refs #12408 --- lib/base/scriptframe.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/base/scriptframe.cpp b/lib/base/scriptframe.cpp index 643cc5527..8f4fa800f 100644 --- a/lib/base/scriptframe.cpp +++ b/lib/base/scriptframe.cpp @@ -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; }