Skip to content

Commit 29578d9

Browse files
mabardg
authored andcommitted
LatteExtension: fix undefined property
1 parent 436137e commit 29578d9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Bridges/ApplicationDI/LatteExtension.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,11 @@ public function beforeCompile()
103103
public static function initLattePanel(ApplicationLatte\TemplateFactory $factory, Tracy\Bar $bar, bool $all = false)
104104
{
105105
$factory->onCreate[] = function (ApplicationLatte\Template $template) use ($bar, $all) {
106-
if ($all || $template->control instanceof Nette\Application\UI\Presenter) {
106+
$control = $template->control ?? null;
107+
if ($all || $control instanceof Nette\Application\UI\Presenter) {
107108
$bar->addPanel(new Latte\Bridges\Tracy\LattePanel(
108109
$template->getLatte(),
109-
$all ? (new \ReflectionObject($template->control))->getShortName() : ''
110+
$all && $control ? (new \ReflectionObject($control))->getShortName() : ''
110111
));
111112
}
112113
};

0 commit comments

Comments
 (0)