diff --git a/frontend/text-editor/src/editor/TextEditor.js b/frontend/text-editor/src/editor/TextEditor.js index e7f82739b1..ed43501b89 100644 --- a/frontend/text-editor/src/editor/TextEditor.js +++ b/frontend/text-editor/src/editor/TextEditor.js @@ -702,7 +702,8 @@ export function isEmpty(instance) { if (isTextEditor(instance)) { return instance.isEmpty; } - throw new TypeError('Instance is not a TextEditor'); + return null; + // throw new TypeError('Instance is not a TextEditor'); } /** @@ -716,7 +717,8 @@ export function getRoot(instance) { if (isTextEditor(instance)) { return instance.root; } - throw new TypeError("Instance is not a TextEditor"); + return null; + // throw new TypeError("Instance is not a TextEditor"); } /** @@ -729,9 +731,10 @@ export function getRoot(instance) { export function setRoot(instance, root) { if (isTextEditor(instance)) { instance.root = root; - return instance; + // return instance; } - throw new TypeError("Instance is not a TextEditor"); + return instance; + // throw new TypeError("Instance is not a TextEditor"); } /** @@ -756,7 +759,8 @@ export function getCurrentStyle(instance) { if (isTextEditor(instance)) { return instance.currentStyle; } - throw new TypeError("Instance is not a TextEditor"); + // throw new TypeError("Instance is not a TextEditor"); + return null; } /** @@ -771,7 +775,8 @@ export function applyStylesToSelection(instance, styles) { if (isTextEditor(instance)) { return instance.applyStylesToSelection(styles); } - throw new TypeError("Instance is not a TextEditor"); + // throw new TypeError("Instance is not a TextEditor"); + return null; } /** @@ -785,7 +790,8 @@ export function dispose(instance) { if (isTextEditor(instance)) { return instance.dispose(); } - throw new TypeError("Instance is not a TextEditor"); + // throw new TypeError("Instance is not a TextEditor"); + return null; } export default TextEditor;