Commit ada4c3ae authored by Peter Notenboom's avatar Peter Notenboom

Fix for /whoami with a user who doesn't have a profile picture

parent f9a90f35
...@@ -22,11 +22,11 @@ class UserProfilePhotos extends Entity ...@@ -22,11 +22,11 @@ class UserProfilePhotos extends Entity
{ {
$this->total_count = isset($data['total_count']) ? $data['total_count'] : null; $this->total_count = isset($data['total_count']) ? $data['total_count'] : null;
if (empty($this->total_count)) { if ($this->total_count === null && !is_numeric($this->total_count) ) {
throw new TelegramException('total_count is empty!'); throw new TelegramException('total_count is empty!');
} }
$this->photos = isset($data['photos']) ? $data['photos'] : null; $this->photos = isset($data['photos']) ? $data['photos'] : null;
if (empty($this->photos)) { if ($this->photos === null || !is_array($data['photos']) ) {
throw new TelegramException('photos is empty!'); throw new TelegramException('photos is empty!');
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment