diff --git a/src/Client.js b/src/Client.js index 4825638..63f3153 100644 --- a/src/Client.js +++ b/src/Client.js @@ -802,7 +802,9 @@ class Client extends EventEmitter { */ async logout() { await this.pupPage.evaluate(() => { - return window.Store.AppState.logout(); + if (window.Store && window.Store.AppState && typeof window.Store.AppState.logout === 'function') { + return window.Store.AppState.logout(); + } }); await this.pupBrowser.close(); @@ -1723,4 +1725,4 @@ class Client extends EventEmitter { } } -module.exports = Client; +module.exports = Client; \ No newline at end of file