From 28aa61dccdfa225cc3f9905da53f2e6801d4ff66 Mon Sep 17 00:00:00 2001
From: srosse <none@none>
Date: Fri, 11 Dec 2015 09:48:01 +0100
Subject: [PATCH] OO-1810: return a dummy object to configure

---
 .../commons/editor/htmleditor/HTMLEditorController.java    | 4 ++++
 .../impl/elements/richText/RichTextConfiguration.java      | 7 ++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/olat/core/commons/editor/htmleditor/HTMLEditorController.java b/src/main/java/org/olat/core/commons/editor/htmleditor/HTMLEditorController.java
index fb823d41242..010853e76e6 100644
--- a/src/main/java/org/olat/core/commons/editor/htmleditor/HTMLEditorController.java
+++ b/src/main/java/org/olat/core/commons/editor/htmleditor/HTMLEditorController.java
@@ -363,6 +363,10 @@ public class HTMLEditorController extends FormBasicController {
 	 * @return
 	 */
 	public RichTextConfiguration getRichTextConfiguration() {
+		if(htmlElement == null) {
+			//if the file is too big, 
+			return new RichTextConfiguration(getLocale());
+		}
 		return htmlElement.getEditorConfiguration();
 	}
 
diff --git a/src/main/java/org/olat/core/gui/components/form/flexible/impl/elements/richText/RichTextConfiguration.java b/src/main/java/org/olat/core/gui/components/form/flexible/impl/elements/richText/RichTextConfiguration.java
index 58590a328d7..a84a694d63b 100644
--- a/src/main/java/org/olat/core/gui/components/form/flexible/impl/elements/richText/RichTextConfiguration.java
+++ b/src/main/java/org/olat/core/gui/components/form/flexible/impl/elements/richText/RichTextConfiguration.java
@@ -150,6 +150,11 @@ public class RichTextConfiguration implements Disposable {
 	
 	private final Locale locale;
 	private TinyConfig tinyConfig;
+	
+	public RichTextConfiguration(Locale locale) {
+		this.locale = locale;
+		tinyConfig = TinyConfig.minimalisticConfig; 
+	}
 
 	/**
 	 * Constructor, only used by RichText element itself. Use
@@ -158,7 +163,7 @@ public class RichTextConfiguration implements Disposable {
 	 * @param domID The ID of the flexi element in the browser DOM
 	 * @param rootFormDispatchId The dispatch ID of the root form that deals with the submit button
 	 */
-	RichTextConfiguration(String domID, String rootFormDispatchId, Locale locale) {
+	public RichTextConfiguration(String domID, String rootFormDispatchId, Locale locale) {
 		this.domID = domID;
 		this.locale = locale;
 		// use exact mode that only applies to this DOM element
-- 
GitLab