We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 999ee2e commit 2762f3cCopy full SHA for 2762f3c
src/Request.php
@@ -317,8 +317,13 @@ public static function send($action, array $data = null)
317
return new ServerResponse($fake_response, $bot_name);
318
}
319
320
- $response = self::executeCurl($action, $data);
321
- return new ServerResponse(json_decode($response, true), $bot_name);
+ $response = json_decode(self::executeCurl($action, $data), true);
+
322
+ if (is_null($response)) {
323
+ throw new TelegramException('Telegram returned an invalid response! Please your bot name and api token.');
324
+ }
325
326
+ return new ServerResponse($response, $bot_name);
327
328
329
/**
0 commit comments