Strict null checks

#60565
This commit is contained in:
Matt Bierner
2018-10-19 12:51:47 -07:00
parent 0ce7badda9
commit 85da9e27d6
10 changed files with 30 additions and 13 deletions

View File

@@ -77,6 +77,10 @@ function getProcessIdWithHighestProperty(processList, propertyName: string) {
function updateProcessInfo(processList): void {
const target = document.getElementById('process-list');
if (!target) {
return;
}
const highestCPUProcess = getProcessIdWithHighestProperty(processList, 'cpu');
const highestMemoryProcess = getProcessIdWithHighestProperty(processList, 'memory');
@@ -127,7 +131,9 @@ function applyStyles(styles: ProcessExplorerStyles): void {
}
styleTag.innerHTML = content.join('\n');
document.head.appendChild(styleTag);
if (document.head) {
document.head.appendChild(styleTag);
}
document.body.style.color = styles.color;
}