From b50e10d7a8f0ab4040d6f6f78232784c7a97c193 Mon Sep 17 00:00:00 2001
From: uhensler <urs.hensler@frentix.com>
Date: Mon, 13 Jan 2020 09:35:57 +0100
Subject: [PATCH] OO-4461:	RS when copy a survey course element with
 invalid configuration

---
 src/main/java/org/olat/course/nodes/SurveyCourseNode.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/olat/course/nodes/SurveyCourseNode.java b/src/main/java/org/olat/course/nodes/SurveyCourseNode.java
index 5bc58de7ce2..5b2e1c88183 100644
--- a/src/main/java/org/olat/course/nodes/SurveyCourseNode.java
+++ b/src/main/java/org/olat/course/nodes/SurveyCourseNode.java
@@ -248,9 +248,11 @@ public class SurveyCourseNode extends AbstractAccessableCourseNode {
 	}
 
 	private void postImportCopy(ICourse course, String nodeIdent) {
+		RepositoryEntry formEntry = getEvaluationForm(getModuleConfiguration());
+		if (formEntry == null) return;
+		
 		RepositoryEntry ores = RepositoryManager.getInstance().lookupRepositoryEntry(course, true);
 		EvaluationFormManager evaluationFormManager = CoreSpringFactory.getImpl(EvaluationFormManager.class);
-		RepositoryEntry formEntry = getEvaluationForm(getModuleConfiguration());
 		EvaluationFormSurveyIdentifier surveyIdent = of(ores, nodeIdent);
 		EvaluationFormSurvey survey = evaluationFormManager.loadSurvey(surveyIdent);
 		if (survey == null) {
-- 
GitLab