diff --git a/src/main/java/org/olat/course/condition/interpreter/IsAssessmentModeFunction.java b/src/main/java/org/olat/course/condition/interpreter/IsAssessmentModeFunction.java index 19bfe600f2af648dd3c2350402b2cb04bded42b9..2f36be97969f2e3c539217c28d45b1aca33a4b1b 100644 --- a/src/main/java/org/olat/course/condition/interpreter/IsAssessmentModeFunction.java +++ b/src/main/java/org/olat/course/condition/interpreter/IsAssessmentModeFunction.java @@ -23,6 +23,7 @@ import java.util.Date; import org.olat.core.CoreSpringFactory; import org.olat.core.gui.control.ChiefController; +import org.olat.core.gui.control.WindowControl; import org.olat.core.id.OLATResourceable; import org.olat.course.assessment.AssessmentModeManager; import org.olat.course.editor.CourseEditorEnv; @@ -60,7 +61,11 @@ public class IsAssessmentModeFunction extends AbstractFunction { return defaultValue(); } - ChiefController chiefController = getUserCourseEnv().getWindowControl().getWindowBackOffice().getChiefController(); + WindowControl wControl = getUserCourseEnv().getWindowControl(); + if(wControl == null) { + return ConditionInterpreter.INT_FALSE; + } + ChiefController chiefController = wControl.getWindowBackOffice().getChiefController(); if(chiefController == null) { return ConditionInterpreter.INT_FALSE; }