Skip to content

Commit 2284fdd

Browse files
author
Graham Butler
committed
fix transformChild bug anf version bump @1.0.5
1 parent 4ccd611 commit 2284fdd

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@author.io/element-control",
3-
"version": "1.0.4",
3+
"version": "1.0.5",
44
"description": "author-control custom element (web component).",
55
"main": "dist/author-control.min.js",
66
"scripts": {

src/element.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,13 @@ class AuthorFormControlElement extends AuthorBaseElement(HTMLElement) {
235235
let filtered = mutations.filter(record => record.addedNodes.item(0).nodeType !== 3)
236236

237237
filtered.forEach((record, index, array) => {
238-
this.PRIVATE.transformChild(record.addedNodes.item(0))
238+
let node = record.addedNodes.item(0)
239+
240+
if (!node) {
241+
return
242+
}
243+
244+
this.PRIVATE.transformChild(node)
239245
})
240246

241247
observer.disconnect()

0 commit comments

Comments
 (0)