ItemsToRender might return NULL // avoid warnings

This commit is contained in:
Stefan Eickhoff 2015-12-06 01:04:35 +01:00
parent db6500c3b0
commit 65b72e6474
1 changed files with 7 additions and 6 deletions

View File

@ -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;
}