Skip to content

Commit

Permalink
Check for nevigator before accessing
Browse files Browse the repository at this point in the history
  • Loading branch information
Ib Green committed May 3, 2019
1 parent b14747c commit 32e22ea
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/addons/src/webvr/vr-display.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import {createEnterVRButton} from './vr-button';

export default class VRDisplay extends Display {
static isSupported() {
return 'getVRDisplays' in navigator && 'VRFrameData' in window;
return (
typeof navigator !== 'undefined' && 'getVRDisplays' in navigator && 'VRFrameData' in window
);
}

constructor(props) {
Expand Down

0 comments on commit 32e22ea

Please sign in to comment.