From 16b56735d1642894d9e54f1c20e34cd758c13b2a Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Fri, 12 Nov 2021 18:45:57 +0300 Subject: [PATCH] [Tests] Fix warning for test session --- src/util/sessions.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/util/sessions.ts b/src/util/sessions.ts index bb6c38bac..f97c7fe70 100644 --- a/src/util/sessions.ts +++ b/src/util/sessions.ts @@ -32,9 +32,12 @@ export function storeSession(sessionData: ApiSessionData, currentUserId?: string Object.keys(keys).map(Number).forEach((dcId) => { localStorage.setItem(`dc${dcId}_auth_key`, JSON.stringify(keys[dcId])); }); - Object.keys(hashes).map(Number).forEach((dcId) => { - localStorage.setItem(`dc${dcId}_hash`, JSON.stringify(hashes[dcId])); - }); + + if (hashes) { + Object.keys(hashes).map(Number).forEach((dcId) => { + localStorage.setItem(`dc${dcId}_hash`, JSON.stringify(hashes[dcId])); + }); + } } export function clearStoredSession() {