Skip to content

Commit 6a5a1f4

Browse files
authored
Merge pull request #454 from kfrajer/master
Fixes #442: NPE when calling background(PIamge)
2 parents 319e266 + f7066c1 commit 6a5a1f4

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)