Fixes #10587: Latest used controller instance was not available in Response::EVENT_AFTER_SEND handler

This commit is contained in:
Alexander Makarov
2016-10-19 12:02:55 +03:00
parent a057c64a6c
commit 8a452bcc2e
2 changed files with 4 additions and 1 deletions

View File

@@ -452,7 +452,9 @@ class Module extends ServiceLocator
$oldController = Yii::$app->controller;
Yii::$app->controller = $controller;
$result = $controller->runAction($actionID, $params);
Yii::$app->controller = $oldController;
if ($oldController !== null) {
Yii::$app->controller = $oldController;
}
return $result;
} else {