Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-38006

Missing NPE Check in SimplePageBean getCurrentPageItem

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: CLOSED
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.9.0, 10.0
    • Fix Version/s: 2.9.0
    • Component/s: Lessons
    • Previous Issue Keys:
      LSNBLDR-206

      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) {

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                hedrick Charles Hedrick
                Reporter:
                jonespm Matthew Jones
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Git Source Code