Fix exception on middleware loader
An exception was thrown when loading middleware if a requested controller is from a disabled plugin, as the `getRequestedController` method returns a Response object in this scenario. Hat tip to @w20k.
This commit is contained in:
parent
9b8974b003
commit
f190f7a347
|
|
@ -77,7 +77,11 @@ class BackendController extends ControllerBase
|
|||
$path = implode('/', $pathParts);
|
||||
|
||||
$requestedController = $this->getRequestedController($path);
|
||||
if (!is_null($requestedController) && count($requestedController['controller']->getMiddleware())) {
|
||||
if (
|
||||
!is_null($requestedController)
|
||||
&& is_array($requestedController)
|
||||
&& count($requestedController['controller']->getMiddleware())
|
||||
) {
|
||||
$action = $requestedController['action'];
|
||||
|
||||
// Collect applicable middleware and insert middleware into pipeline
|
||||
|
|
|
|||
Loading…
Reference in New Issue