Commit 281f39e1 authored by MBoretto's avatar MBoretto

check also for null duration

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