check active view can determined for getting debug bar component

This commit is contained in:
Daniel Seifert 2022-08-02 09:15:02 +02:00
bovenliggende d20aeeb661
commit df1c58954f
Getekend door: DanielS
GPG sleutel-ID: 8A7C4C6ED1915C6F

Bestand weergeven

@ -50,10 +50,14 @@ class ShopControl_DebugBar extends ShopControl_DebugBar_parent
{
if (!isAdmin()) {
/** @var DebugBarComponent $debugBarComponent */
$debugBarComponent = Registry::getConfig()->getActiveView()->getComponent(DebugBarComponent::class);
echo $debugBarComponent->getRenderer()->renderHead();
$debugBarComponent->addTimelineMessures();
echo $debugBarComponent->getRenderer()->render();
$activeView = Registry::getConfig()->getActiveView();
if ($activeView &&
$debugBarComponent = $activeView->getComponent(DebugBarComponent::class)
) {
echo $debugBarComponent->getRenderer()->renderHead();
$debugBarComponent->addTimelineMessures();
echo $debugBarComponent->getRenderer()->render();
}
}
}
}