Skip to content

Commit

Permalink
fix bigskysoftware#2932: check parent is null for swap delete
Browse files Browse the repository at this point in the history
  • Loading branch information
jackielii committed Sep 25, 2024
1 parent aad0fbc commit b6d93eb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/htmx.js
Original file line number Diff line number Diff line change
Expand Up @@ -1696,7 +1696,10 @@ var htmx = (function() {
*/
function swapDelete(target) {
cleanUpElement(target)
return parentElt(target).removeChild(target)
const parent = parentElt(target)
if (parent) {
parent.removeChild(target)
}
}

/**
Expand Down

0 comments on commit b6d93eb

Please sign in to comment.