From 2029ced8e1d478ac7e952c948b4eaecbf2058d3b Mon Sep 17 00:00:00 2001 From: xsellier Date: Wed, 6 Aug 2014 11:41:12 -0400 Subject: [PATCH] Create a html element if it does not exists, to prevent out-of-bound error --- src/term.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/term.js b/src/term.js index f26617d..aa3af50 100644 --- a/src/term.js +++ b/src/term.js @@ -1326,6 +1326,9 @@ Terminal.prototype.refresh = function(start, end) { out += ''; } + if (this.children[y] == null || this.children[y] == "undefined") { + this.children[y] = this.document.createElement("span"); + } this.children[y].innerHTML = out; }