Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
defense code for this.helper.parentNode.removeChild(this.helper);
  • Loading branch information
LeeeeeeM committed Sep 13, 2023
1 parent caf3c4f commit ed03217
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/SortableContainer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,9 @@ export default function sortableContainer(
}

// Remove the helper from the DOM
this.helper.parentNode.removeChild(this.helper);
if (this.helper && this.helper.parentNode) {
this.helper.parentNode.removeChild(this.helper);
}

if (hideSortableGhost && this.sortableGhost) {
setInlineStyles(this.sortableGhost, {
Expand Down

0 comments on commit ed03217

Please sign in to comment.