From e626692e313777ad5762f3ec978837df7104379f Mon Sep 17 00:00:00 2001 From: Lennart Carstens-Behrens Date: Fri, 31 Jul 2020 12:06:35 +0200 Subject: [PATCH] catch exception for not existing blade files. --- src/Views/Compilers/BladeSourceMapCompiler.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Views/Compilers/BladeSourceMapCompiler.php b/src/Views/Compilers/BladeSourceMapCompiler.php index 48cff78d..f7089ee2 100644 --- a/src/Views/Compilers/BladeSourceMapCompiler.php +++ b/src/Views/Compilers/BladeSourceMapCompiler.php @@ -2,13 +2,19 @@ namespace Facade\Ignition\Views\Compilers; +use ErrorException; use Illuminate\View\Compilers\BladeCompiler; class BladeSourceMapCompiler extends BladeCompiler { public function detectLineNumber(string $filename, int $exceptionLineNumber): int { - $map = $this->compileString(file_get_contents($filename)); + try { + $map = $this->compileString(file_get_contents($filename)); + } catch (ErrorException $e) { + return 1; + } + $map = explode("\n", $map); $line = $map[$exceptionLineNumber - 1] ?? $exceptionLineNumber;