Skip to content
This repository has been archived by the owner on Jun 15, 2022. It is now read-only.

Commit

Permalink
fix: check if keychain is object before checking keys
Browse files Browse the repository at this point in the history
  • Loading branch information
antsgar committed Mar 5, 2021
1 parent e09189c commit c3671d2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lib/installation_service.ts
Expand Up @@ -32,8 +32,10 @@ export class InstallationService extends ApplicationService {
const hasNormalKeys =
this.application?.hasAccount() || this.application?.hasPasscode();
const keychainKey = await this.application?.deviceInterface?.getRawKeychainValue();
const hasKeychainValue =
!isNullOrUndefined(keychainKey) && Object.keys(keychainKey).length > 0;
const hasKeychainValue = !(
isNullOrUndefined(keychainKey) ||
(typeof keychainKey === 'object' && Object.keys(keychainKey).length === 0)
);

let firstRunKey = await this.application?.getValue(
FIRST_RUN_KEY,
Expand Down

0 comments on commit c3671d2

Please sign in to comment.