Skip to content

Commit

Permalink
Fix: Return null if thumbnail_url is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnitto committed Sep 13, 2021
1 parent 322eedb commit 6b51ad4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Classes/Eel/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function vimeoThumbnail($videoID): ?string
return null;
}
$utility = new Utility();
return $utility->removeProtocolFromUrl($data['thumbnail_url']);
return $utility->removeProtocolFromUrl($data['thumbnail_url'] ?? null);
}

/**
Expand Down
5 changes: 4 additions & 1 deletion Classes/Service/YoutubeService.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ public function getAndSaveDataFromApi(NodeInterface $node, bool $remove = false)
$image = $data['imageUrl'];
$resolution = $data['imageResolution'];
} else {
$youtubeImageArray = $this->getBestPossibleYoutubeImage($videoID, $data['thumbnail_url']);
$youtubeImageArray = $this->getBestPossibleYoutubeImage(
$videoID,
$data['thumbnail_url'] ?? null
);
$image = $youtubeImageArray['image'];
$resolution = $youtubeImageArray['resolution'];
}
Expand Down

0 comments on commit 6b51ad4

Please sign in to comment.