From c5e5ed86f66de1338a067787d2e05038dfd1a3db Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Wed, 15 Apr 2015 10:38:26 -0700 Subject: [PATCH] fix surrogate crash. --- lib/widget.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/widget.js b/lib/widget.js index f4eaed9..40978ff 100644 --- a/lib/widget.js +++ b/lib/widget.js @@ -3997,7 +3997,7 @@ Element.prototype.render = function() { // Handle surrogate pairs: // Make sure we put surrogate pair chars in one cell. - if (this.screen.fullUnicode) { + if (this.screen.fullUnicode && content[ci - 1]) { var code = content[ci - 1].charCodeAt(0); // if (content.codePointAt(ci - 1) > 0xffff) { if (code >= 0xd800 && code <= 0xdbff) {