Skip to content

Commit 5735b93

Browse files
committed
Catch create WebGLRenderer error
1 parent 58a6b2a commit 5735b93

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

webclient/src/spaceport/scene.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ export const scene = ({ ref }) => {
1313

1414
var scene = new THREE.Scene();
1515

16-
const renderer = new THREE.WebGLRenderer({ antialias: true });
16+
try {
17+
const renderer = new THREE.WebGLRenderer({ antialias: true });
18+
} catch (error) {
19+
console.log('Problem creating WebGLRenderer:', error);
20+
return;
21+
}
1722

1823
const width = ref.current.clientWidth;
1924
const height = ref.current.clientHeight;

0 commit comments

Comments
 (0)