Bug 978 : Null pointer exception when using P2D
Last modified: 2008-11-28 16:57




Status:
RESOLVED
Resolution:
FIXED -
Priority:
P2
Severity:
normal

 

Reporter:
pfig
Assigned To:
REAS

Attachment Type Created Size Actions

Description:   Opened: 2008-10-22 16:21
Hi,

when trying to run the following code from the Getting Started tutorial:

void setup() {
size( 400, 400, P2D );
stroke( 255 );
}

void draw() {
line( 150, 25, mouseX, mouseY );
}

void mousePressed() {
background( 192, 64, 0 );
}

I get a null pointer exception:

Exception in thread "Animation Thread" java.lang.NullPointerException
at processing.core.PGraphics2D.resetMatrix(PGraphics2D.java:1849)
at processing.core.PGraphics2D.beginDraw(PGraphics2D.java:116)
at processing.core.PApplet.handleDraw(PApplet.java:1365)
at processing.core.PApplet.run(PApplet.java:1300)
at java.lang.Thread.run(Thread.java:613)

This only happens with P2D, the code works with all the other renderers. I'm running
Processing 0154 on Mac OS X 10.5.5 (fully patched), on a new Macbook Pro (using the slower
graphics card, an Nvidia 9400M).

Cheers,

Pedro
Additional Comment #1 From REAS 2008-11-28 16:57
This was fixed for Processing 1.0.