Skip to content

Commit

Permalink
fix: check that view path exists before adding.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Thulin committed Oct 6, 2023
1 parent 1b4e504 commit 02a9ea1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion source/php/Init.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ public function __construct($externalViewPaths) {

if(is_array($viewPaths) && !empty($viewPaths)) {
foreach ($viewPaths as $path) {
$blade->addViewPath(rtrim($path, DIRECTORY_SEPARATOR));
$directory = rtrim($path, DIRECTORY_SEPARATOR);
if(is_dir($directory)) {
$blade->addViewPath(rtrim($path, DIRECTORY_SEPARATOR));
}
}
} else {
throw new \Exception("View paths not defined.");
Expand Down

0 comments on commit 02a9ea1

Please sign in to comment.