Uploaded image for project: 'OpenOLAT'
  1. OpenOLAT
  2. OO-2143

RS when copying a course with an empty checklist

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.5.4
    • Fix Version/s: 10.5.5
    • Component/s: Course
    • Labels:
      None

      Description

      A null pointer exception occurs when copying a course with an empty checklist. If the list is empty in the postCopy method the value of the list variable is null. A list.getList() is not allowed in this case.

      This fixes the problem:

      diff --git a/src/main/java/org/olat/course/nodes/CheckListCourseNode.java b/src/main/java/org/olat/course/nodes/CheckListCourseNode.java
      --- a/src/main/java/org/olat/course/nodes/CheckListCourseNode.java
      +++ b/src/main/java/org/olat/course/nodes/CheckListCourseNode.java
      @@ -644,6 +644,7 @@
       		ModuleConfiguration config = getModuleConfiguration();
       		CheckboxManager checkboxManager = CoreSpringFactory.getImpl(CheckboxManager.class);
       		CheckboxList list = (CheckboxList)config.get(CONFIG_KEY_CHECKBOX);
      +		if (list !=null && !list.getList().isEmpty())
       		for(Checkbox checkbox:list.getList()) {
       			String sourceId = checkbox.getCheckboxId();
       			String targetId = envMapper.getTargetUniqueKey(getIdent(), sourceId);
      

        Attachments

          Activity

            People

            Assignee:
            srosse Stéphane Rossé
            Reporter:
            stephan Stephan Clemenz
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 15 minutes
                15m