Fix null not being handled properly in _findTab result (#1331)

This commit is contained in:
toasted-nutbread 2021-01-30 14:06:43 -05:00 committed by GitHub
parent ba8b02cda5
commit 0ba1427775
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1809,7 +1809,7 @@ class Backend {
switch (mode) { switch (mode) {
case 'existingOrNewTab': case 'existingOrNewTab':
if (useSettingsV2) { if (useSettingsV2) {
const tab = await this._findTab(1000, (url2) => url2.startsWith(url)); const tab = await this._findTab(1000, (url2) => (url2 !== null && url2.startsWith(url)));
if (tab !== null) { if (tab !== null) {
await this._focusTab(tab); await this._focusTab(tab);
} else { } else {