History

Fixed crash on starting in VR mode with V8

ksuprynowicz committed 3 years ago

Commit b52fe9a1 parent ceeac402 files · +6 −0Browse files

Showing the changes to libraries/script-engine/src/v8/ScriptValueIteratorV8Wrapper.cpp (1 of 2 files). Show all

Unified · Split

libraries/script-engine/src/v8/ScriptValueIteratorV8Wrapper.cpp+5−0
@@ -83,6 +83,11 @@ V8ScriptValue V8ScriptValueIterator::value() { · 82 unmodified lines
8383 if (!_object.Get(isolate)->Get(context, propertyName->ToString(context).ToLocalChecked()).ToLocal(&v8Value)) {
8484 Q_ASSERT(false);
8585 }
86+ //V8TODO: sometimes no value gets written to v8Value. This needs to be investigated and fixed.
87+ if (v8Value.IsEmpty()) {
88+ qDebug() << "V8ScriptValueIterator::value: value handle is empty for key: " << *v8::String::Utf8Value(isolate, propertyName->ToString(context).ToLocalChecked());
89+ v8Value = v8::Undefined(isolate);
90+ }
8691 return V8ScriptValue(_engine, v8Value);
8792 }
8893