optional chaining

This commit is contained in:
Erik 2022-11-15 16:15:58 +02:00
parent 89e6ab5984
commit 5fe415dfcf
Signed by: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB

View File

@ -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 });