summaryrefslogtreecommitdiff
path: root/fxjs/fxjs_v8.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fxjs/fxjs_v8.cpp')
-rw-r--r--fxjs/fxjs_v8.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/fxjs/fxjs_v8.cpp b/fxjs/fxjs_v8.cpp
index d3d2010b30..05986b4eb8 100644
--- a/fxjs/fxjs_v8.cpp
+++ b/fxjs/fxjs_v8.cpp
@@ -409,8 +409,12 @@ void CFXJS_Engine::InitializeEngine() {
} else if (pObjDef->m_ObjType == FXJSOBJTYPE_STATIC) {
v8::Local<v8::String> pObjName = NewString(pObjDef->m_ObjName);
v8::Local<v8::Object> obj = NewFxDynamicObj(i, true);
- v8Context->Global()->Set(v8Context, pObjName, obj).FromJust();
- m_StaticObjects[i] = new v8::Global<v8::Object>(m_isolate, obj);
+ if (!obj.IsEmpty()) {
+ v8Context->Global()->Set(v8Context, pObjName, obj).FromJust();
+ m_StaticObjects[i] = new v8::Global<v8::Object>(m_isolate, obj);
+ } else {
+ m_StaticObjects[i] = nullptr;
+ }
}
}
m_V8PersistentContext.Reset(m_isolate, v8Context);