Null pointer exception calling image() on PGraphics
in
Programming Questions
•
2 years ago
Hi,
My issue is that I'm having a null pointer exception when calling image(canvas,0,0) on my PGraphics object (canvas). This only happens when the renderer is set to JAVA2D. The error says:
Exception in thread "Animation Thread" java.lang.NullPointerException
at java.lang.System.arraycopy(Native Method)
at sun.awt.image.IntegerInterleavedRaster.setDataElements(Unknown Source)
at processing.core.PGraphicsJava2D.updatePixels(Unknown Source)
at processing.core.PGraphicsJava2D.imageImpl(Unknown Source)
at processing.core.PGraphics.image(Unknown Source)
at processing.core.PApplet.image(Unknown Source)
at Folder.render(Folder.java:41)
at Main.draw(Main.java:60)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
I have debugged and found that the inData Object of the setDataElements method is null.
My problem is identical to this thread -
http://processing.org/discourse/yabb2/YaBB.pl?num=1264911247
but it is in the old forum. I would message Nnd. but can't seem to find them!
I can post my code if need be, but it's rather messy so if the problem doesn't have an easy solution I will do.
I'd be hugely grateful for any help here - I'm normally pretty good at solving problems myself using the web, but this has stumped me and can't find nowt out there (apart from the above thread but that was never concluded).
Cheers,
Rob
1