From df4daee7023bc4a66a230d6255b7026521509786 Mon Sep 17 00:00:00 2001 From: David Brophy Date: Wed, 31 Aug 2016 21:59:46 +0100 Subject: [PATCH] Prevent call to replaceChild if parentNode is null --- domutil.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/domutil.go b/domutil.go index 78c7d85b..4541173c 100644 --- a/domutil.go +++ b/domutil.go @@ -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) }