diff --git a/src/SecurityManager.ts b/src/SecurityManager.ts index 11d228e7ab..03cbe88c22 100644 --- a/src/SecurityManager.ts +++ b/src/SecurityManager.ts @@ -105,9 +105,12 @@ async function getSecretStorageKey( // use the default SSSS key if set keyInfo = keyInfos[keyId]; if (!keyInfo) { - throw new Error("Unable to use default SSSS key"); + // if the default key is not available, pretend the default key + // isn't set + keyId = undefined; } - } else { + } + if (!keyId) { // if no default SSSS key is set, fall back to a heuristic of using the // only available key, if only one key is set const keyInfoEntries = Object.entries(keyInfos);