Skip to content

Commit f105c0d

Browse files
committed
Check account presence before getting public state
Fixes EXTENSION-ER
1 parent 51b0452 commit f105c0d

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/background.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -845,17 +845,14 @@ class BackgroundService extends EventEmitter {
845845
takeUntil(fromWebExtensionEvent(port.onDisconnect)),
846846
switchMap(([, areaName]) =>
847847
areaName === 'local' &&
848-
Boolean(
849-
this.permissionsController.hasPermission(
850-
origin,
851-
PERMISSIONS.APPROVED
852-
)
853-
)
848+
this.preferencesController.getSelectedAccount() != null &&
849+
this.permissionsController.hasPermission(origin, PERMISSIONS.APPROVED)
854850
? fromPromise(this.getPublicState(origin, connectionId))
855851
: empty
856852
),
857853
onStart(async () => {
858854
if (
855+
this.preferencesController.getSelectedAccount() != null &&
859856
this.permissionsController.hasPermission(
860857
origin,
861858
PERMISSIONS.APPROVED

0 commit comments

Comments
 (0)