Merge pull request #1861 from Tyriar/1860_style_npe

Add sanity checks to dom renderer underline code
This commit is contained in:
Daniel Imms
2019-01-01 11:47:17 -08:00
committed by GitHub
+5 -3
View File
@@ -364,9 +364,11 @@ export class DomRenderer extends EventEmitter implements IRenderer {
return; return;
} }
const span = <HTMLElement>row.children[x]; const span = <HTMLElement>row.children[x];
span.style.textDecoration = enabled ? 'underline' : 'none'; if (span) {
x = (x + 1) % cols; span.style.textDecoration = enabled ? 'underline' : 'none';
if (x === 0) { }
if (++x >= cols) {
x = 0;
y++; y++;
} }
} }