Skip to content

Commit 51b70a3

Browse files
authored
Check if XRSession exists before adding inputsourceschange listener (#5631)
1 parent a5177ad commit 51b70a3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/systems/tracked-controls.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ module.exports.System = registerSystem('tracked-controls', {
1717
},
1818

1919
onEnterVR: function () {
20+
var xrSession = this.el.xrSession;
21+
if (!xrSession) { return; }
2022
this.el.xrSession.addEventListener('inputsourceschange', this.onInputSourcesChange);
2123
},
2224

0 commit comments

Comments
 (0)