Skip to content

Commit 4345b05

Browse files
committed
Fixed null preprocessable params bug
1 parent afa2851 commit 4345b05

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/PreprocessWord.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@
77

88
trait PreprocessWord
99
{
10-
protected static function preprocessedWord(string $word, Morphy $morphy): string
10+
protected static function preprocessedWord(?string $word, Morphy $morphy): ?string
1111
{
12+
if ($word === null) {
13+
return null;
14+
}
15+
1216
return $morphy->isInUpperCase() ? Str::upper(trim($word)) : Str::lower(trim($word));
1317
}
1418

0 commit comments

Comments
 (0)