From 9378483378a7ea0663382c6793c1c0cd54c7fec5 Mon Sep 17 00:00:00 2001 From: Dylan Sweetensen Date: Wed, 12 Jul 2017 09:23:30 +1200 Subject: [PATCH] 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. --- code/extensions/SiteTreeContentReview.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/extensions/SiteTreeContentReview.php b/code/extensions/SiteTreeContentReview.php index 381c369..4a02590 100644 --- a/code/extensions/SiteTreeContentReview.php +++ b/code/extensions/SiteTreeContentReview.php @@ -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;