check for not existing controller function
This commit is contained in:
parent
75146c8a08
commit
4c21a850d8
@ -49,7 +49,9 @@ class ShopControl_DebugBar extends ShopControl_DebugBar_parent
|
|||||||
if (AvailabilityCheck::isAvailable() && AvailabilityCheck::ifDebugBarNotSet() && AvailabilityCheck::ifNoErrorOccured()) {
|
if (AvailabilityCheck::isAvailable() && AvailabilityCheck::ifDebugBarNotSet() && AvailabilityCheck::ifNoErrorOccured()) {
|
||||||
$activeView = Registry::getConfig()->getTopActiveView();
|
$activeView = Registry::getConfig()->getTopActiveView();
|
||||||
/** @var DebugBarComponent|null $debugBarComponent */
|
/** @var DebugBarComponent|null $debugBarComponent */
|
||||||
$debugBarComponent = $activeView->getComponent(DebugBarComponent::class);
|
$debugBarComponent = method_exists($activeView, 'getComponent')
|
||||||
|
? $activeView->getComponent(DebugBarComponent::class)
|
||||||
|
: null;
|
||||||
if ($debugBarComponent) {
|
if ($debugBarComponent) {
|
||||||
AvailabilityCheck::markDebugBarAsSet();
|
AvailabilityCheck::markDebugBarAsSet();
|
||||||
echo $debugBarComponent->getRenderer()->renderHead();
|
echo $debugBarComponent->getRenderer()->renderHead();
|
||||||
|
@ -97,7 +97,9 @@ function debugVar($mVar, bool $blToFile = false): void
|
|||||||
}
|
}
|
||||||
$activeView = Registry::getConfig()->getTopActiveView();
|
$activeView = Registry::getConfig()->getTopActiveView();
|
||||||
/** @var DebugBarComponent|null $debugBarComponent */
|
/** @var DebugBarComponent|null $debugBarComponent */
|
||||||
$debugBarComponent = $activeView->getComponent(DebugBarComponent::class);
|
$debugBarComponent = method_exists($activeView, 'getComponent')
|
||||||
|
? $activeView->getComponent(DebugBarComponent::class)
|
||||||
|
: null;
|
||||||
if ($debugBarComponent === null) {
|
if ($debugBarComponent === null) {
|
||||||
throw new UnavailableException();
|
throw new UnavailableException();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user