Skip to content

Commit 76fce67

Browse files
authored
Added typing guards. (#11382)
1 parent f3e0f0b commit 76fce67

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Extension/ui/settings.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,12 @@ class SettingsApp {
8181
// Set view state of advanced settings and add event
8282
const oldState: any = this.vsCodeApi.getState();
8383
const advancedShown: boolean = oldState && oldState.advancedShown;
84-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
85-
document.getElementById(elementId.advancedSection)!.style.display = advancedShown ? "block" : "none";
84+
85+
const advancedSection: HTMLElement | null = document.getElementById(elementId.advancedSection);
86+
if (advancedSection) {
87+
advancedSection.style.display = advancedShown ? "block" : "none";
88+
}
89+
8690
document.getElementById(elementId.showAdvanced)?.classList.toggle(advancedShown ? "collapse" : "expand", true);
8791
document.getElementById(elementId.showAdvanced)?.addEventListener("click", this.onShowAdvanced.bind(this));
8892
this.vsCodeApi.postMessage({

0 commit comments

Comments
 (0)