@@ -17,7 +17,6 @@ import { StateService as BaseStateService } from "../../deps/bw/libs/shared/dist
1717import { PasswordTokenRequest } from "../../deps/bw/libs/shared/dist/src/models/request/identityToken/passwordTokenRequest";
1818import { TokenRequestTwoFactor } from "../../deps/bw/libs/common/src/models/request/identityToken/tokenRequestTwoFactor.ts";
1919
20−
2120function sanitize(obj) {
2221 return JSON.parse(JSON.stringify(obj));
2322}
@@ -201,7 +200,12 @@ class BrowserCryptoService extends CryptoService {
201200 async retrieveKeyFromStorage(keySuffix) {
202201 if (keySuffix === "biometric") {
203202 await this.platformUtilService.authenticateBiometric();
204− return (await this.getKey())?.keyB64;
203+ const k = await this.getKey()
204+ if (k == null) {
205+ return null
206+ } else {
207+ return k.keyB64
208+ }
205209 }
206210
207211 return await super.retrieveKeyFromStorage(keySuffix);
@@ -502,8 +506,8 @@ class StateService extends BaseStateService {
502506 }
503507
504508 async getBrowserGroupingComponentState(options) {
505− return (await this.getAccount(this.reconcileOptions(options, this.defaultInMemoryOptions)))
506− ?.groupings;
509+ const x = await this.getAccount(this.reconcileOptions(options, this.defaultInMemoryOptions))
510+ return x == null ? null : x.groupings;
507511 }
508512
509513 async setBrowserGroupingComponentState(value, options) {
@@ -515,8 +519,8 @@ class StateService extends BaseStateService {
515519 }
516520
517521 async getBrowserCipherComponentState(options) {
518− return (await this.getAccount(this.reconcileOptions(options, this.defaultInMemoryOptions)))
519− ?.ciphers;
522+ const x = await this.getAccount(this.reconcileOptions(options, this.defaultInMemoryOptions))
523+ return x == null ? null : x.ciphers;
520524 }
521525
522526 async setBrowserCipherComponentState(value, options) {
@@ -528,8 +532,8 @@ class StateService extends BaseStateService {
528532 }
529533
530534 async getBrowserSendComponentState(options) {
531− return (await this.getAccount(this.reconcileOptions(options, this.defaultInMemoryOptions)))
532− ?.send;
535+ const x = await this.getAccount(this.reconcileOptions(options, this.defaultInMemoryOptions))
536+ return x == null ? null : x.send;
533537 }
534538
535539 async setBrowserSendComponentState(value, options) {
@@ -540,8 +544,8 @@ class StateService extends BaseStateService {
540544 await this.saveAccount(account, this.reconcileOptions(options, this.defaultInMemoryOptions));
541545 }
542546 async getBrowserSendTypeComponentState(options) {
543− return (await this.getAccount(this.reconcileOptions(options, this.defaultInMemoryOptions)))
544− ?.sendType;
547+ const x = await this.getAccount(this.reconcileOptions(options, this.defaultInMemoryOptions))
548+ return x == null ? null : x.sendType;
545549 }
546550
547551 async setBrowserSendTypeComponentState(value, options) {