From 5fe415dfcf206444c49f9d39bb7bd6d5597f851f Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Tue, 15 Nov 2022 16:15:58 +0200 Subject: [PATCH] optional chaining --- src/server/components/UserDatabase.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/components/UserDatabase.js b/src/server/components/UserDatabase.js index fcaab99..a41840d 100644 --- a/src/server/components/UserDatabase.js +++ b/src/server/components/UserDatabase.js @@ -95,7 +95,7 @@ class UserDatabase extends AbstractUserDatabase { if (!token) throw new Error('Missing token'); - let app = this.cache.find(a => a.token.encrypted === token); + let app = this.cache.find(a => a.token?.encrypted === token); if (app) return Promise.resolve(app); const data = await this.db.findOne(this._appCollection, { 'token.encrypted': token });