Missing NPE Check in SimplePageBean getCurrentPageItem

Description

In this block here for 1.4.x (Revision 116853) we had an instructor encounter an NPE.
java.lang.NullPointerException
at org.sakaiproject.lessonbuildertool.tool.beans.SimplePageBean.getCurrentPageItem(SimplePageBean.java:1632)
at org.sakaiproject.lessonbuildertool.tool.producers.ShowPageProducer.fillComponents(ShowPageProducer.java:442)
at uk.org.ponder.rsf.view.support.ViewCollector.fillComponents(ViewCollector.java:56)
. . .

In trunk that corresponds to line 1686. Somehow the ret is null from this simplePageToolDao. I'm not sure how to reproduce it though. He was unable to access for a few times but it eventually started working. Should probably be an NPE check around this condition but not testable unless you know how it could happen?

Thanks

1682 if(ret == null && page.getOwner() != null) {
1683 ret = simplePageToolDao.findItemFromStudentPage(page.getPageId());
1684 }
1685 try {
1686 updatePageItem(ret.getId());
1687 } catch (PermissionException e) {

Activity

Show:
Fixed

Details

Priority

Affects versions

Fix versions

Components

Assignee

Reporter

Created March 6, 2013 at 6:58 PM
Updated April 18, 2018 at 7:30 AM
Resolved March 12, 2013 at 3:45 PM

Flag notifications