]> git.agnieray.net Git - galette.git/commitdiff
No null to trim()
authorJohan Cwiklinski <johan@x-tnd.be>
Sun, 10 Oct 2021 11:59:10 +0000 (13:59 +0200)
committerJohan Cwiklinski <johan@x-tnd.be>
Sun, 17 Oct 2021 04:15:40 +0000 (06:15 +0200)
galette/lib/Galette/Entity/Adherent.php

index 624c01fe9cbd337d6832422cca1b5d9dfe275a93..afaec078d663f623775e03e5b2f8bdffceb51a1f 100644 (file)
@@ -944,7 +944,7 @@ class Adherent
     {
         $label = $this->fields[$field]['label'];
         //remove trailing ':' and then nbsp (for french at least)
-        $label = trim(trim($label, ':'), '&nbsp;');
+        $label = trim(trim($label ?? '', ':'), '&nbsp;');
         return $label;
     }
 
@@ -1074,7 +1074,7 @@ class Adherent
             if (isset($values[$key])) {
                 $value = $values[$key];
                 if ($value !== true && $value !== false) {
-                    $value = trim($value);
+                    $value = trim($value ?? '');
                 }
             } elseif (empty($this->_id)) {
                 switch ($key) {