From 82961d7fa54222b72efe12a3a440a4dc936727b0 Mon Sep 17 00:00:00 2001 From: Mahdi Dibaiee Date: Mon, 27 Jul 2015 10:08:52 +0430 Subject: [PATCH] build --- build/functions/fetch.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/functions/fetch.js b/build/functions/fetch.js index 26e4fc1..d29d59d 100644 --- a/build/functions/fetch.js +++ b/build/functions/fetch.js @@ -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); diff --git a/package.json b/package.json index 032c8da..fbbe1b7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "telegram-api", - "version": "0.5.21", + "version": "0.5.22", "description": "Control Telegram bots easily using the new Telegram API", "main": "index.js", "scripts": {