Browse Source

stay defensive, stay safe

Raanan Weber 4 years ago
parent
commit
b7b63cc54d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/XR/features/WebXRControllerTeleportation.ts

+ 1 - 1
src/XR/features/WebXRControllerTeleportation.ts

@@ -764,7 +764,7 @@ export class WebXRMotionControllerTeleportation extends WebXRAbstractFeature {
 
     private _teleportForward(controllerId: string) {
         const controllerData = this._controllers[controllerId];
-        if (!controllerData.teleportationState.forward) {
+        if (!controllerData || !controllerData.teleportationState.forward) {
             return;
         }
         controllerData.teleportationState.forward = false;