diff --git a/src/telegramPolling.js b/src/telegramPolling.js index 365c168..6943ceb 100644 --- a/src/telegramPolling.js +++ b/src/telegramPolling.js @@ -146,7 +146,7 @@ class TelegramBotPolling { return this.request('getUpdates', opts) .catch(err => { - if (err.response.statusCode === ANOTHER_WEB_HOOK_USED) { + if (err.response && err.response.statusCode === ANOTHER_WEB_HOOK_USED) { return this._unsetWebHook(); } throw err;