Throw if session hasn't been loaded

This commit is contained in:
Will Hunt 2023-11-14 09:59:33 +00:00 committed by GitHub
parent 44f20d54b0
commit e5b87a8518
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -343,6 +343,9 @@ export class Client {
* @param {string} token A Matrix Access Token
*/
async updateAccessToken(token) {
if (!_this.session) {
throw Error("No session loaded, cannot update access token");
}
this._session.updateAccessToken(token);
await this._platform.sessionInfoStorage.updateAccessToken(this._sessionId, token);
}