Add null check on Terminal.element

Since the Terminal can be used now before being attached, we should check element on destroy.

Related to #266
This commit is contained in:
Daniel Imms
2017-02-01 11:50:52 -08:00
committed by GitHub
parent 742d28fcc3
commit 833eb5216b
+1 -1
View File
@@ -1045,7 +1045,7 @@ Terminal.prototype.destroy = function() {
this._events = {};
this.handler = function() {};
this.write = function() {};
if (this.element.parentNode) {
if (this.element && this.element.parentNode) {
this.element.parentNode.removeChild(this.element);
}
//this.emit('close');