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;
}
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++;
}
}