Skip to content

Commit

Permalink
Merge pull request #117 from steiha/patch-1
Browse files Browse the repository at this point in the history
ItemsToRender might return NULL // avoid warnings
  • Loading branch information
Damian Mooyman committed Feb 4, 2016
2 parents 9aac12a + 65b72e6 commit 04131d5
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions code/model/WidgetArea.php
Expand Up @@ -30,14 +30,15 @@ class WidgetArea extends DataObject
public function WidgetControllers()
{
$controllers = new ArrayList();
$items = $this->ItemsToRender();
if (!is_null($items)){
foreach ($items as $widget) {
$controller = $widget->getController();

foreach ($this->ItemsToRender() as $widget) {
$controller = $widget->getController();

$controller->init();
$controllers->push($controller);
$controller->init();
$controllers->push($controller);
}
}

return $controllers;
}

Expand Down

0 comments on commit 04131d5

Please sign in to comment.