From 833eb5216bad3096463f7bda675582a0b9184d3f Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Wed, 1 Feb 2017 11:50:52 -0800 Subject: [PATCH] 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 --- src/xterm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xterm.js b/src/xterm.js index 6204d135..664d1812 100644 --- a/src/xterm.js +++ b/src/xterm.js @@ -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');