don't try to access properties of null attributes

This commit is contained in:
mike-000
2021-12-21 17:21:25 +00:00
committed by GitHub
parent 5267e30d6d
commit 792f937aa5

View File

@@ -273,7 +273,7 @@ class WebGLPostProcessingPass {
const canvasId = getUid(gl.canvas);
if (!frameState.renderTargets[canvasId]) {
const attributes = gl.getContextAttributes();
if (attributes.preserveDrawingBuffer) {
if (attributes && attributes.preserveDrawingBuffer) {
gl.clearColor(0.0, 0.0, 0.0, 0.0);
gl.clear(gl.COLOR_BUFFER_BIT);
}