diff --git a/Modules/Core/ShopControl_DebugBar.php b/Modules/Core/ShopControl_DebugBar.php index 606764e..4b1854c 100644 --- a/Modules/Core/ShopControl_DebugBar.php +++ b/Modules/Core/ShopControl_DebugBar.php @@ -49,7 +49,9 @@ class ShopControl_DebugBar extends ShopControl_DebugBar_parent if (AvailabilityCheck::isAvailable() && AvailabilityCheck::ifDebugBarNotSet() && AvailabilityCheck::ifNoErrorOccured()) { $activeView = Registry::getConfig()->getTopActiveView(); /** @var DebugBarComponent|null $debugBarComponent */ - $debugBarComponent = $activeView->getComponent(DebugBarComponent::class); + $debugBarComponent = method_exists($activeView, 'getComponent') + ? $activeView->getComponent(DebugBarComponent::class) + : null; if ($debugBarComponent) { AvailabilityCheck::markDebugBarAsSet(); echo $debugBarComponent->getRenderer()->renderHead(); diff --git a/Modules/functions.php b/Modules/functions.php index 39fb8eb..76fb9a9 100644 --- a/Modules/functions.php +++ b/Modules/functions.php @@ -97,7 +97,9 @@ function debugVar($mVar, bool $blToFile = false): void } $activeView = Registry::getConfig()->getTopActiveView(); /** @var DebugBarComponent|null $debugBarComponent */ - $debugBarComponent = $activeView->getComponent(DebugBarComponent::class); + $debugBarComponent = method_exists($activeView, 'getComponent') + ? $activeView->getComponent(DebugBarComponent::class) + : null; if ($debugBarComponent === null) { throw new UnavailableException(); }