#1003 Potential NPE in XYLineAndShapeRenderer

closed-fixed
None
5
2012-09-23
2010-06-15
Opeongo
No

The drawItem method will try to look up optional entity information, but will fail with an NPE if info.getOwner() returns null. This can happen if the draw method is called on the JFreeChart object. I suggest that the code in drawItem should include a test for the owner being null.

if (state.getInfo() != null && state.getInfo().getOwner() != null) {
entities = state.getInfo().getOwner().getEntityCollection();
}

Discussion

  • David Gilbert

    David Gilbert - 2012-09-23
    • assigned_to: nobody --> mungady
    • status: open --> closed-fixed
     
  • David Gilbert

    David Gilbert - 2012-09-23

    I'm not able to see how this can be triggered, but it will not hurt to put the null check so I've done this for the upcoming 1.0.15 release.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks