Bug 1311587 - Make sure OpenVR is installed before handling user inputs; draft
authordmu@mozilla.com <dmu@mozilla.com>
Thu, 20 Oct 2016 04:01:04 +0000
changeset 428134 4a1c1addda7dc79f489a2b0c6a5ca37b98441fc4
parent 428133 28681d252003e3110105473754da2f4097cb83a6
child 534654 0884a1cc0125f4bec749fffdd5c4b9138fd0dc3f
push id33225
push userbmo:dmu@mozilla.com
push dateFri, 21 Oct 2016 15:19:23 +0000
bugs1311587
milestone52.0a1
Bug 1311587 - Make sure OpenVR is installed before handling user inputs;
gfx/vr/gfxVROpenVR.cpp
--- a/gfx/vr/gfxVROpenVR.cpp
+++ b/gfx/vr/gfxVROpenVR.cpp
@@ -555,16 +555,20 @@ VRControllerManagerOpenVR::Destroy()
 }
 
 void
 VRControllerManagerOpenVR::HandleInput()
 {
   RefPtr<impl::VRControllerOpenVR> controller;
   vr::VRControllerState_t state;
 
+  if (!mOpenVRInstalled) {
+    return;
+  }
+
   MOZ_ASSERT(mVRSystem);
 
   // Process OpenVR controller state
   for (uint32_t i = 0; i < mOpenVRController.Length(); ++i) {
     controller = mOpenVRController[i];
 
     MOZ_ASSERT(mVRSystem->GetTrackedDeviceClass(controller->GetTrackedIndex())
                == vr::TrackedDeviceClass_Controller);