Explorar o código

Fix BanList\trimToNull()

Visman %!s(int64=4) %!d(string=hai) anos
pai
achega
ebd25a22d3
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  1. 3 2
      app/Models/BanList/Model.php

+ 3 - 2
app/Models/BanList/Model.php

@@ -30,9 +30,10 @@ class Model extends ParentModel
     /**
      * Фильтрует значение
      */
-    public function trimToNull(/* mixed */ $val, bool $toLower = false): ?string
+    public function trimToNull(?string $val, bool $toLower = false): ?string
     {
-        $val = \trim($val);
+        $val = \trim($val ?? '');
+
         if ('' == $val) {
             return null;
         } elseif ($toLower) {