Skip to content

Commit

Permalink
Fix for null nodes that might be embedded in old source sheets
Browse files Browse the repository at this point in the history
  • Loading branch information
rneiss committed Mar 21, 2022
1 parent 74bce37 commit efd13db
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion static/js/Editor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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")) {
Expand Down

0 comments on commit efd13db

Please sign in to comment.