Skip to content

Commit

Permalink
Fix error when the url is invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
frandieguez committed Aug 14, 2018
1 parent d274a1c commit 03ce11a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Panorama/Video.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,11 @@ public function camelize($lowerCaseAndUnderscoredWord)
*/
public static function getDomain($url = '')
{
$host = parse_url($url);
$host = parse_url($url);

if (!array_key_exists('host', $host)) {
throw new \Exception('Video service or Url not supported');
}
$domainParts = preg_split("@\.@", $host['host']);

/*
Expand Down

0 comments on commit 03ce11a

Please sign in to comment.