Add sanity checks to dom renderer underline code

Fixes #1860
This commit is contained in:
Daniel Imms
2018-12-26 10:53:40 -08:00
parent 272cb08472
commit 9e3e724f63
+5 -3
View File
@@ -364,9 +364,11 @@ export class DomRenderer extends EventEmitter implements IRenderer {
return;
}
const span = <HTMLElement>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++;
}
}