From 39fde2cefc9c972f43e2da77d72810178e0c7e59 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Mon, 14 Mar 2022 04:42:06 +0000 Subject: [PATCH] Catch create WebGLRenderer error --- webclient/src/spaceport/scene.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/webclient/src/spaceport/scene.js b/webclient/src/spaceport/scene.js index 9924f7f..a35282f 100644 --- a/webclient/src/spaceport/scene.js +++ b/webclient/src/spaceport/scene.js @@ -13,7 +13,13 @@ export const scene = ({ ref }) => { var scene = new THREE.Scene(); - const renderer = new THREE.WebGLRenderer({ antialias: true }); + let renderer = null; + try { + renderer = new THREE.WebGLRenderer({ antialias: true }); + } catch (error) { + console.log('Problem creating WebGLRenderer:', error); + return; + } const width = ref.current.clientWidth; const height = ref.current.clientHeight;