Fix exception with missing key

This commit is contained in:
Alexander Zinchuk 2021-06-14 00:40:27 +03:00
parent 61ec929a7d
commit 8b04a985bf
2 changed files with 4 additions and 0 deletions

View File

@ -89,6 +89,8 @@ class CallbackSession extends MemorySession {
.keys(this._authKeys)
.forEach((dcId) => {
const authKey = this._authKeys[dcId];
if (!authKey._key) return;
sessionData.keys[dcId] = authKey._key.toString('hex');
sessionData.hashes[dcId] = authKey._hash.toString('hex');
});

View File

@ -110,6 +110,8 @@ class StorageSession extends MemorySession {
.keys(this._authKeys)
.forEach((dcId) => {
const authKey = this._authKeys[dcId];
if (!authKey._key) return;
sessionData.keys[dcId] = asHex ? authKey._key.toString('hex') : authKey._key;
sessionData.hashes[dcId] = asHex ? authKey._hash.toString('hex') : authKey._hash;
});