Skip to content

Commit e42541b

Browse files
janbarasekdg
authored andcommitted
Bridge: Template line can be null. (#384)
1 parent b4160e3 commit e42541b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Bridges/Nette/Bridge.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public static function renderLatteError(?\Throwable $e): ?array
5252
$lines = file($file);
5353
if (preg_match('#// source: (\S+\.latte)#', $lines[1], $m) && @is_file($m[1])) { // @ - may trigger error
5454
$templateFile = $m[1];
55-
$templateLine = preg_match('#/\* line (\d+) \*/#', $lines[$e->getLine() - 1], $m) ? (int) $m[1] : null;
55+
$templateLine = $e->getLine() && preg_match('#/\* line (\d+) \*/#', $lines[$e->getLine() - 1], $m) ? (int) $m[1] : null;
5656
return [
5757
'tab' => 'Template',
5858
'panel' => '<p><b>File:</b> ' . Helpers::editorLink($templateFile, $templateLine) . '</p>'

0 commit comments

Comments
 (0)