Merge pull request #13151 from mike-000/null-attributes
Avoid error accessing attributes when context is lost
This commit is contained in:
@@ -273,7 +273,7 @@ class WebGLPostProcessingPass {
|
|||||||
const canvasId = getUid(gl.canvas);
|
const canvasId = getUid(gl.canvas);
|
||||||
if (!frameState.renderTargets[canvasId]) {
|
if (!frameState.renderTargets[canvasId]) {
|
||||||
const attributes = gl.getContextAttributes();
|
const attributes = gl.getContextAttributes();
|
||||||
if (attributes.preserveDrawingBuffer) {
|
if (attributes && attributes.preserveDrawingBuffer) {
|
||||||
gl.clearColor(0.0, 0.0, 0.0, 0.0);
|
gl.clearColor(0.0, 0.0, 0.0, 0.0);
|
||||||
gl.clear(gl.COLOR_BUFFER_BIT);
|
gl.clear(gl.COLOR_BUFFER_BIT);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user