NullPointerException when calling save() after surface.setSize() in P2D

Processing.org/reference/saveFrame_.html