Bug 1337441 - Prevent crash when accessing VRDisplayEvent.display within onvrdisplayactivate
- A non-null value is now always returned, as VRDisplayEvent.display
is required.
MozReview-Commit-ID: IrE2a7rw3Co
--- a/dom/vr/VRDisplayEvent.cpp
+++ b/dom/vr/VRDisplayEvent.cpp
@@ -59,16 +59,17 @@ VRDisplayEvent::Constructor(mozilla::dom
const VRDisplayEventInit& aEventInitDict)
{
RefPtr<VRDisplayEvent> e = new VRDisplayEvent(aOwner);
bool trusted = e->Init(aOwner);
e->InitEvent(aType, aEventInitDict.mBubbles, aEventInitDict.mCancelable);
if (aEventInitDict.mReason.WasPassed()) {
e->mReason = Some(aEventInitDict.mReason.Value());
}
+ e->mDisplay = aEventInitDict.mDisplay;
e->SetTrusted(trusted);
e->SetComposed(aEventInitDict.mComposed);
return e.forget();
}
already_AddRefed<VRDisplayEvent>
VRDisplayEvent::Constructor(const GlobalObject& aGlobal, const nsAString& aType,
const VRDisplayEventInit& aEventInitDict,