Skip to content

Commit

Permalink
fix: rendering/html-core - null checks (#3823)
Browse files Browse the repository at this point in the history
  • Loading branch information
lkho authored Apr 12, 2021
1 parent 70d4c06 commit a20f70e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/modules/rendering/html-core/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ module.exports = {
// --------------------------------

$('body').contents().toArray().forEach(item => {
if (item.type === 'text' && item.parent.name === 'body') {
if (item && item.type === 'text' && item.parent.name === 'body') {
$(item).wrap('<div></div>')
}
})
Expand All @@ -249,7 +249,7 @@ module.exports = {
function iterateMustacheNode (node) {
const list = $(node).contents().toArray()
list.forEach(item => {
if (item.type === 'text') {
if (item && item.type === 'text') {
const rawText = $(item).text().replace(/\r?\n|\r/g, '')
if (mustacheRegExp.test(rawText)) {
$(item).parent().attr('v-pre', true)
Expand Down

0 comments on commit a20f70e

Please sign in to comment.