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

QuestionPoolBean.titleComparator throws NPE is the title is null

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: RESOLVED
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.6.2, 2.7.2, 2.8.0
    • Fix Version/s: 2.9.0
    • Labels:
      None
    • Previous Issue Keys:
      SAM-1174

      Description

      We have seen situations where the title of question pools is null. I think perhaps from importing content from bb using the importservice. In any event the code should not be making assumptions about the title being not null in the TitleComparator. I'm attaching an easy patch that fixes this issue.

      2010-11-09 10:26:35,263 ERROR ajp-10.10.12.35-8009-2 org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/samigo].[Faces Servlet] - Servlet.service() for servlet Faces Servlet threw exception
      java.lang.NullPointerException
      at org.sakaiproject.tool.assessment.ui.bean.questionpool.QuestionPoolBean$titleComparator.compare(QuestionPoolBean.java:227)
      at java.util.Arrays.mergeSort(Arrays.java:1284)
      at java.util.Arrays.sort(Arrays.java:1223)
      at java.util.Collections.sort(Collections.java:159)
      at org.sakaiproject.tool.assessment.ui.bean.questionpool.QuestionPoolBean.sortQpoolsByProperty(QuestionPoolBean.java:241)
      at org.sakaiproject.tool.assessment.ui.bean.questionpool.QuestionPoolBean.sortPoolByLevel(QuestionPoolBean.java:1975)
      at org.sakaiproject.tool.assessment.ui.bean.questionpool.QuestionPoolBean.setQpDataModelByLevel(QuestionPoolBean.java:2071)
      at org.sakaiproject.tool.assessment.ui.listener.questionpool.QuestionPoolListener.processAction(QuestionPoolListener.java:50)
      at javax.faces.event.ActionEvent.processListener(ActionEvent.java:57)
      at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:649)
      at javax.faces.component.UICommand.broadcast(UICommand.java:297)
      at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)
      at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:307)
      at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:79)
      at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)

        Gliffy Diagrams

          Zeplin

            Attachments

              Issue Links

                Activity

                  People

                  Assignee:
                  ktsao Karen Tsao
                  Reporter:
                  jbush John Bush
                  Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                    Dates

                    Created:
                    Updated:
                    Resolved:

                      Git Integration