diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d5b0dc2e..b7a1354c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -101,6 +101,7 @@ jobs: - name: Version Test run: | + sudo apt-get update sudo apt install libsecret-1-0 dbus-x11 gnome-keyring eval $(dbus-launch --sh-syntax) diff --git a/src/services/keytarSecureStorage.service.ts b/src/services/keytarSecureStorage.service.ts index faadcde5..be06aa49 100644 --- a/src/services/keytarSecureStorage.service.ts +++ b/src/services/keytarSecureStorage.service.ts @@ -16,6 +16,12 @@ export class KeytarSecureStorageService implements StorageService { } save(key: string, obj: any): Promise { + // keytar throws if you try to save a falsy value: https://github.com/atom/node-keytar/issues/86 + // handle this by removing the key instead + if (!obj) { + return this.remove(key); + } + return setPassword(this.serviceName, key, JSON.stringify(obj)); }