Skip to content

Commit b2e0dcb

Browse files
committed
switch to typeof this.pixels == undefined
1 parent c1e7900 commit b2e0dcb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/webgl/p5.RendererGL.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ p5.RendererGL.prototype.loadPixels = function() {
624624
h *= pd;
625625
//if there isn't a renderer-level temporary pixels buffer
626626
//make a new one
627-
if (this.pixels === undefined) {
627+
if (typeof this.pixels === 'undefined') {
628628
this.pixels = new Uint8Array(
629629
this.GL.drawingBufferWidth * this.GL.drawingBufferHeight * 4
630630
);
@@ -672,7 +672,7 @@ p5.RendererGL.prototype.resize = function(w, h) {
672672
this._setDefaultCamera();
673673
}
674674
//resize pixels buffer
675-
if (this.pixels !== undefined) {
675+
if (typeof this.pixels !== 'undefined') {
676676
this.pixels = new Uint8Array(
677677
this.GL.drawingBufferWidth * this.GL.drawingBufferHeight * 4
678678
);

0 commit comments

Comments
 (0)