Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
Fix crash on browsers where the xr object wasn't on the navigator (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
Belchy06 committed Feb 15, 2023
1 parent b659a5d commit a9e52d4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Frontend/library/src/WebXR/WebXRController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,10 @@ export class WebXRController {
}

static isSessionSupported(mode: XRSessionMode): Promise<boolean> {
return navigator.xr.isSessionSupported(mode);
if(navigator.xr) {
return navigator.xr.isSessionSupported(mode);
} else {
return new Promise<boolean>(() => { return false; })
}
}
}

0 comments on commit a9e52d4

Please sign in to comment.