Skip to content

Commit

Permalink
fix crash with manual squads
Browse files Browse the repository at this point in the history
  • Loading branch information
recursivetree committed Dec 2, 2023
1 parent 6ba895f commit 2f5076d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Models/Filterable.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ abstract public function getFilters(): stdClass;
*/
final public function isEligible(Model $member): bool
{
// in case no filters exists, bypass check and return not eligible
// in case no filters exists, everyone should be allowed
// this is the case with manual squads
if (! property_exists($this->getFilters(), 'and') && ! property_exists($this->getFilters(), 'or'))
throw new InvalidFilterException('root filter configuration is not a rule group');
return true;

$query = new QueryGroupBuilder($member->newQuery(), true);

Expand Down

0 comments on commit 2f5076d

Please sign in to comment.