Skip to content

Commit

Permalink
Fix "undefined .nodetype" kinda error
Browse files Browse the repository at this point in the history
  • Loading branch information
calebporzio committed Jul 29, 2023
1 parent 98a0fff commit 5edf11b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/morph/src/morph.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ export function morph(from, toHtml, options) {
}

// Handle conditional markers (presumably added by backends like Livewire)...
let isIf = node => node.nodeType === 8 && node.textContent === ' __BLOCK__ '
let isEnd = node => node.nodeType === 8 && node.textContent === ' __ENDBLOCK__ '
let isIf = node => node && node.nodeType === 8 && node.textContent === ' __BLOCK__ '
let isEnd = node => node && node.nodeType === 8 && node.textContent === ' __ENDBLOCK__ '

if (isIf(currentTo) && isIf(currentFrom)) {
let newFromChildren = []
Expand Down

0 comments on commit 5edf11b

Please sign in to comment.