From 23169e89c8c65464c8bf16374e07b4e7669b843c Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Thu, 12 Jan 2017 11:14:14 -0800 Subject: [PATCH 1/2] Add null checks to refresh line and character fetches Fixes #473 --- src/xterm.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/xterm.js b/src/xterm.js index b6c659c3..a46d0152 100644 --- a/src/xterm.js +++ b/src/xterm.js @@ -1139,6 +1139,10 @@ Terminal.prototype.refresh = function(start, end) { row = y + this.ydisp; line = this.lines.get(row); + if (!line) { + // Continue if the line is not available, this means a resize is currently in progress + continue; + } out = ''; if (this.y === y - (this.ybase - this.ydisp) @@ -1153,6 +1157,10 @@ Terminal.prototype.refresh = function(start, end) { i = 0; for (; i < width; i++) { + if (!line[i]) { + // Continue if the character is not available, this means a resize is currently in progress + continue; + } data = line[i][0]; ch = line[i][1]; ch_width = line[i][2]; From 3de3912b96dce8ef1d900108cd64412ea19eb11a Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Thu, 12 Jan 2017 11:23:17 -0800 Subject: [PATCH 2/2] Add another null check on children[y] --- src/xterm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xterm.js b/src/xterm.js index a46d0152..b01421b1 100644 --- a/src/xterm.js +++ b/src/xterm.js @@ -1139,7 +1139,7 @@ Terminal.prototype.refresh = function(start, end) { row = y + this.ydisp; line = this.lines.get(row); - if (!line) { + if (!line || !this.children[y]) { // Continue if the line is not available, this means a resize is currently in progress continue; }