Skip to content

Commit

Permalink
Bugfix: Prevent error/warning (#191)
Browse files Browse the repository at this point in the history
* Prevent error/warning
"trim(): Argument #1 ($string) must be of type string, null given"

because trim() is only applyable on strings - not if it is null

* Apply php-cs-fixer changes

---------

Co-authored-by: ctippler <[email protected]>
  • Loading branch information
ctippler and ctippler authored Jul 18, 2024
1 parent b2db0f2 commit e463b0d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/FilterService/FilterType/ElasticSearch/Input.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ public function addCondition(AbstractFilterDefinitionType $filterDefinition, Pro
$value = $preSelect;
}

$value = trim($value);
if(is_string($value)) {
$value = trim($value);
}

$currentFilter[$field] = $value;

if (!empty($value)) {
Expand Down

0 comments on commit e463b0d

Please sign in to comment.