Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 5f74fac

Browse files
committed
fall back to the old method if the default key isn't available
1 parent a61462b commit 5f74fac

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/SecurityManager.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,12 @@ async function getSecretStorageKey(
105105
// use the default SSSS key if set
106106
keyInfo = keyInfos[keyId];
107107
if (!keyInfo) {
108-
throw new Error("Unable to use default SSSS key");
108+
// if the default key is not available, pretend the default key
109+
// isn't set
110+
keyId = undefined;
109111
}
110-
} else {
112+
}
113+
if (!keyId) {
111114
// if no default SSSS key is set, fall back to a heuristic of using the
112115
// only available key, if only one key is set
113116
const keyInfoEntries = Object.entries(keyInfos);

0 commit comments

Comments
 (0)