Skip to content

Commit f7066c1

Browse files
authored
Fixes #442: NPE when calling background(PIamge)
Issue documented at #442 Kf
1 parent 319e266 commit f7066c1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

core/src/processing/opengl/PGraphicsOpenGL.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5792,6 +5792,7 @@ protected void setImpl(PImage sourceImage,
57925792

57935793
// Copies the pixels
57945794
loadPixels();
5795+
if(sourceImage.pixels==null) sourceImage.loadPixels();
57955796
int sourceOffset = sourceY * sourceImage.pixelWidth + sourceX;
57965797
int targetOffset = targetY * pixelWidth + targetX;
57975798
for (int y = sourceY; y < sourceY + sourceHeight; y++) {

0 commit comments

Comments
 (0)