Skip to content
Snippets Groups Projects
Commit aef88fed authored by Ere Maijala's avatar Ere Maijala Committed by Demian Katz
Browse files

Missing current view model should not cause Piwik helper to fail.

parent 224d3e63
Branches
Tags
No related merge requests found
......@@ -266,7 +266,11 @@ class Piwik extends \Zend\View\Helper\AbstractHelper
protected function getCombinedSearchResults()
{
$viewModel = $this->getView()->plugin('view_model');
$children = $viewModel->getCurrent()->getChildren();
$current = $viewModel->getCurrent();
if (null === $current) {
return null;
}
$children = $current->getChildren();
if (isset($children[0])) {
$results = $children[0]->getVariable('combinedResults');
if (is_array($results)) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment