From efd13db80424faea5d347255f0aeae9fa8581044 Mon Sep 17 00:00:00 2001 From: Russel Neiss Date: Mon, 21 Mar 2022 12:59:57 -0500 Subject: [PATCH] Fix for null nodes that might be embedded in old source sheets --- static/js/Editor.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/static/js/Editor.jsx b/static/js/Editor.jsx index bc09378a64..a9a78edd0a 100644 --- a/static/js/Editor.jsx +++ b/static/js/Editor.jsx @@ -206,7 +206,11 @@ export const deserialize = el => { if (TEXT_TAGS[nodeName]) { const attrs = TEXT_TAGS[nodeName](el); - return children.map(child => jsx('text', attrs, ((typeof child === "string" || Text.isText(child)) ? child : Node.string(child)))) + return children.map(child => { + if (!child) {return null} + return jsx('text', attrs, ((typeof child === "string" || Text.isText(child)) ? child : Node.string(child))) + } + ) } if (el.getAttribute("style")) {