diff --git a/ts/lib.ts b/ts/lib.ts index 766139de..18f5668d 100644 --- a/ts/lib.ts +++ b/ts/lib.ts @@ -187,7 +187,9 @@ class Settings { } onCapturableList(window_names: string[]) { - let current_selection = this.capturable_select.selectedOptions[0]?.textContent; + let current_selection = undefined; + if (this.capturable_select.selectedOptions[0]) + current_selection = this.capturable_select.selectedOptions[0].textContent; let new_index; this.capturable_select.innerText = ""; window_names.forEach((name, i) => {