Commit 8c30df89 authored by MBoretto's avatar MBoretto

allow value 0 for duration

parent e8400d66
...@@ -34,7 +34,7 @@ class Audio extends Entity ...@@ -34,7 +34,7 @@ class Audio extends Entity
} }
$this->duration = isset($data['duration']) ? $data['duration'] : null; $this->duration = isset($data['duration']) ? $data['duration'] : null;
if (empty($this->duration)) { if ($this->duration === '') {
throw new TelegramException('duration is empty!'); throw new TelegramException('duration is empty!');
} }
......
...@@ -45,7 +45,7 @@ class Video extends Entity ...@@ -45,7 +45,7 @@ class Video extends Entity
throw new TelegramException('height is empty!'); throw new TelegramException('height is empty!');
} }
$this->duration = isset($data['duration']) ? $data['duration'] : null; $this->duration = isset($data['duration']) ? $data['duration'] : null;
if (empty($this->duration)) { if ($this->duration === '') {
throw new TelegramException('duration is empty!'); throw new TelegramException('duration is empty!');
} }
$this->thumb = isset($data['thumb']) ? $data['thumb'] : null; $this->thumb = isset($data['thumb']) ? $data['thumb'] : null;
......
...@@ -32,7 +32,7 @@ class Voice extends Entity ...@@ -32,7 +32,7 @@ class Voice extends Entity
} }
$this->duration = isset($data['duration']) ? $data['duration'] : null; $this->duration = isset($data['duration']) ? $data['duration'] : null;
if (empty($this->duration)) { if ($this->duration === '') {
throw new TelegramException('duration is empty!'); throw new TelegramException('duration 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