Skip to content

Commit

Permalink
Prevent call to replaceChild if parentNode is null
Browse files Browse the repository at this point in the history
  • Loading branch information
dave committed Sep 1, 2016
1 parent 37ea0dc commit df4daee
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions domutil.go
Expand Up @@ -10,5 +10,8 @@ func replaceNode(newNode, oldNode *js.Object) {
if newNode == oldNode {
return
}
if oldNode.Get("parentNode") == (*js.Object)(nil) {
return
}
oldNode.Get("parentNode").Call("replaceChild", newNode, oldNode)
}

0 comments on commit df4daee

Please sign in to comment.