From 9e3e724f63f0de83a86997041395bea58ad8009e Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Wed, 26 Dec 2018 10:53:40 -0800 Subject: [PATCH] Add sanity checks to dom renderer underline code Fixes #1860 --- src/renderer/dom/DomRenderer.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/renderer/dom/DomRenderer.ts b/src/renderer/dom/DomRenderer.ts index a0cefd677c..c5ef212da6 100644 --- a/src/renderer/dom/DomRenderer.ts +++ b/src/renderer/dom/DomRenderer.ts @@ -364,9 +364,11 @@ export class DomRenderer extends EventEmitter implements IRenderer { return; } const span = row.children[x]; - span.style.textDecoration = enabled ? 'underline' : 'none'; - x = (x + 1) % cols; - if (x === 0) { + if (span) { + span.style.textDecoration = enabled ? 'underline' : 'none'; + } + if (++x >= cols) { + x = 0; y++; } }