Skip to content

Commit 6bf622e

Browse files
authored
Fix session restore rejection
If there is no session the further logic should not be executed
1 parent 22d769a commit 6bf622e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

JavaScript/session.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ class Session extends Map {
4343
if (sessionToken) {
4444
return new Promise((resolve, reject) => {
4545
storage.get(sessionToken, (err, session) => {
46-
if (err) reject(new Error('No session'));
46+
if (err) {
47+
reject(new Error('No session'));
48+
return;
49+
}
4750
Object.setPrototypeOf(session, Session.prototype);
4851
client.token = sessionToken;
4952
client.session = session;

0 commit comments

Comments
 (0)