Fixing method call bug in canBeReviewedBy() (#1)

If getOptions returns false, then canBeReviewedBy() throws "Call to a member function OwnerGroups() on boolean".
This will return false, in the the case that options are false.
This commit is contained in:
Dylan Sweetensen 2017-07-12 09:23:30 +12:00 committed by GitHub
parent 1711eb8aa6
commit 9378483378
1 changed files with 4 additions and 0 deletions

View File

@ -453,6 +453,10 @@ class SiteTreeContentReview extends DataExtension implements PermissionProvider
}
$options = $this->getOptions();
if (!$options) {
return false;
}
if ($options->OwnerGroups()->count() == 0 && $options->OwnerUsers()->count() == 0) {
return false;