Check if incoming element is non-null before attempting to append to it

This commit is contained in:
Ryan Leckey
2017-07-13 02:32:43 -07:00
parent 52bfe3eee5
commit d0588cd812

View File

@@ -3271,7 +3271,7 @@ class CustomGutterDecorationComponent {
if (newProps.className !== oldProps.className) this.element.className = newProps.className || ''
if (newProps.element !== oldProps.element) {
if (this.element.firstChild) this.element.firstChild.remove()
this.element.appendChild(newProps.element)
if (newProps.element != null) this.element.appendChild(newProps.element)
}
}
}