Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drawImage method (Line 2520) perhaps needs a null check #6

Closed
jsnoriegam opened this issue Aug 30, 2016 · 2 comments

Comments

@jsnoriegam
Copy link

jsnoriegam commented Aug 30, 2016

I'm using PDFBox > PDFRenderer.renderPageToGraphics to create an SVG from a PDF page and i was getting a NullPointerException every time, then, after a long backtrace i found this: drawImage(img, null, null) on their code, and i'm not really sure if the problem is in your code but this is what i found on the Java Specification:

(https://docs.oracle.com/javase/8/docs/api/java/awt/Graphics2D.html)

If an AffineTransform is passed to drawImage(Image, AffineTransform, ImageObserver), the AffineTransform is used to transform the bounding box from image space to user space. If no AffineTransform is supplied, the bounding box is treated as if it is already in user space.

I'm guessing you need to do a null check on that method.

Thanks.

jfree added a commit that referenced this issue Aug 30, 2016
@jfree

This comment has been minimized.

Copy link
Owner

jfree commented Aug 30, 2016

You are right! Thanks for the feedback. I just added a test that shows the NullPointerException, and now I will add the null check.

jfree added a commit that referenced this issue Aug 30, 2016
@jfree

This comment has been minimized.

Copy link
Owner

jfree commented Aug 30, 2016

Done.

@jfree jfree closed this Aug 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.