diff --git a/framework/core/src/Frontend/Compiler/Source/FileSource.php b/framework/core/src/Frontend/Compiler/Source/FileSource.php index cc5056b60..c4b16839e 100644 --- a/framework/core/src/Frontend/Compiler/Source/FileSource.php +++ b/framework/core/src/Frontend/Compiler/Source/FileSource.php @@ -11,6 +11,8 @@ namespace Flarum\Frontend\Compiler\Source; +use InvalidArgumentException; + class FileSource implements SourceInterface { /** @@ -23,6 +25,10 @@ class FileSource implements SourceInterface */ public function __construct(string $path) { + if (! file_exists($path)) { + throw new InvalidArgumentException("File not found at path: $path"); + } + $this->path = $path; }