Skip to content

Commit aa792c9

Browse files
ngokevindmarcos
authored andcommitted
handle null device from xr.getDevice (aframevr#4030)
1 parent 38b6c33 commit aa792c9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/utils/device.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ var vrDisplay;
33
// Support both WebVR and WebXR APIs.
44
if (navigator.xr) {
55
navigator.xr.requestDevice().then(function (device) {
6+
if (!device) { return; }
67
device.supportsSession({immersive: true, exclusive: true}).then(function () {
78
var sceneEl = document.querySelector('a-scene');
89
vrDisplay = device;

0 commit comments

Comments
 (0)