If a value is not defined, only return an empty list if this is actually a list value.
authorFlorian Forster <octo@leeloo.(none)>
Sun, 11 Jun 2006 14:24:47 +0000 (16:24 +0200)
committerFlorian Forster <octo@leeloo.(none)>
Sun, 11 Jun 2006 14:24:47 +0000 (16:24 +0200)
The problem occured when querying an unset password.

lib/LiCoM/Person.pm

index 887e39e..0773f5b 100644 (file)
@@ -492,7 +492,7 @@ sub set
        }
        if (!defined ($ValidFields{$field}))
        {
-               return (undef);
+               return;
        }
 
        if (defined ($value))
@@ -514,7 +514,10 @@ sub set
                $entry->update ($Ldap);
        }
 
-       $obj->{$field} = [] unless (defined ($obj->{$field}));
+       if (!defined ($obj->{$field}) and $ValidFields{$field})
+       {
+               $obj->{$field} = [];
+       }
        
        if (wantarray () and $ValidFields{$field})
        {