mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 03:48:44 +02:00
Fixed crash on starting in VR mode with V8
This commit is contained in:
parent
ceeac40ea8
commit
b52fe9a7d5
2 changed files with 6 additions and 0 deletions
|
@ -163,6 +163,7 @@ ScriptObjectV8Proxy* ScriptObjectV8Proxy::unwrapProxy(const V8ScriptValue& val)
|
||||||
//V8TODO This shouldn't cause problems but I'm not sure if it's ok
|
//V8TODO This shouldn't cause problems but I'm not sure if it's ok
|
||||||
//v8::HandleScope handleScope(const_cast<v8::Isolate*>(val.constGetIsolate()));
|
//v8::HandleScope handleScope(const_cast<v8::Isolate*>(val.constGetIsolate()));
|
||||||
auto v8Value = val.constGet();
|
auto v8Value = val.constGet();
|
||||||
|
Q_ASSERT(!v8Value.IsEmpty());
|
||||||
if (v8Value->IsNullOrUndefined()) {
|
if (v8Value->IsNullOrUndefined()) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,6 +83,11 @@ V8ScriptValue V8ScriptValueIterator::value() {
|
||||||
if (!_object.Get(isolate)->Get(context, propertyName->ToString(context).ToLocalChecked()).ToLocal(&v8Value)) {
|
if (!_object.Get(isolate)->Get(context, propertyName->ToString(context).ToLocalChecked()).ToLocal(&v8Value)) {
|
||||||
Q_ASSERT(false);
|
Q_ASSERT(false);
|
||||||
}
|
}
|
||||||
|
//V8TODO: sometimes no value gets written to v8Value. This needs to be investigated and fixed.
|
||||||
|
if (v8Value.IsEmpty()) {
|
||||||
|
qDebug() << "V8ScriptValueIterator::value: value handle is empty for key: " << *v8::String::Utf8Value(isolate, propertyName->ToString(context).ToLocalChecked());
|
||||||
|
v8Value = v8::Undefined(isolate);
|
||||||
|
}
|
||||||
return V8ScriptValue(_engine, v8Value);
|
return V8ScriptValue(_engine, v8Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue