Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ItemsToRender might return NULL // avoid warnings #117

Merged
merged 1 commit into from
Feb 4, 2016
Merged

ItemsToRender might return NULL // avoid warnings #117

merged 1 commit into from
Feb 4, 2016

Conversation

steiha
Copy link
Contributor

@steiha steiha commented Dec 6, 2015

add a check to prevent many messages in silverstripe warning log

@@ -30,14 +30,15 @@ class WidgetArea extends DataObject
public function WidgetControllers()
{
$controllers = new ArrayList();
$items = $this->ItemsToRender();
if (!is_null($items)){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think using !empty() is better here as it's a bit more flexible

tractorcow pushed a commit that referenced this pull request Feb 4, 2016
ItemsToRender might return NULL // avoid warnings
@tractorcow tractorcow merged commit 04131d5 into silverstripe:master Feb 4, 2016
@tractorcow
Copy link
Contributor

It's good enough a fix. :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants