Skip to content

Commit

Permalink
Check if XRSession exists before adding inputsourceschange listener (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mrxz authored Jan 22, 2025
1 parent a5177ad commit 51b70a3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/systems/tracked-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ module.exports.System = registerSystem('tracked-controls', {
},

onEnterVR: function () {
var xrSession = this.el.xrSession;
if (!xrSession) { return; }
this.el.xrSession.addEventListener('inputsourceschange', this.onInputSourcesChange);
},

Expand Down

0 comments on commit 51b70a3

Please sign in to comment.