This commit is contained in:
Mahdi Dibaiee
2015-07-27 10:08:52 +04:30
parent 10a8af0431
commit 82961d7fa5
2 changed files with 2 additions and 2 deletions

View File

@ -47,7 +47,7 @@ function fetch(path) {
}
_unirest2['default'].post('https://api.telegram.org/bot' + path).field(data).attach(files).end(function (response) {
if (response.statusType === 4 || response.statusType === 5 || !response.body.ok) {
if (response.statusType === 4 || response.statusType === 5 || !response.body || !response.body.ok) {
reject(response);
} else {
resolve(response.body);