Skip to content

Commit 762b917

Browse files
authored
Avoid Passing null to parameter exception on PHP 8.1 (#43951)
1 parent f4846cc commit 762b917

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Illuminate/Database/Query/Builder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -846,8 +846,8 @@ protected function invalidOperatorAndValue($operator, $value)
846846
*/
847847
protected function invalidOperator($operator)
848848
{
849-
return ! in_array(strtolower($operator), $this->operators, true) &&
850-
! in_array(strtolower($operator), $this->grammar->getOperators(), true);
849+
return ! is_string($operator) || (! in_array(strtolower($operator), $this->operators, true) &&
850+
! in_array(strtolower($operator), $this->grammar->getOperators(), true));
851851
}
852852

853853
/**

0 commit comments

Comments
 (0)