Skip to content

Commit

Permalink
fix(ResponsiveImageCraft): throw exception if disk url is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaume-infernal committed Aug 4, 2023
1 parent b348e46 commit e196e9b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/ResponsiveImageCraft.php
Expand Up @@ -2,6 +2,8 @@

namespace Infernalmedia\ResponsiveImageCraft;

use Infernalmedia\ResponsiveImageCraft\Exceptions\InvalidDiskException;

class ResponsiveImageCraft
{
/**
Expand Down Expand Up @@ -31,6 +33,11 @@ public function getCssVariables(string $file, int $maxWidth, array $extensions =
}

$baseUrl = config('filesystem.' . config('responsive-image-craft.source_disk') . '.url');

if (empty($baseUrl)) {
throw InvalidDiskException::urlIsMissing();
}

if (str_ends_with($baseUrl, '/')) {
$baseUrl = rtrim($baseUrl, '/');
}
Expand Down

0 comments on commit e196e9b

Please sign in to comment.