From: Florian Forster Date: Sun, 11 Jun 2006 14:24:47 +0000 (+0200) Subject: If a value is not defined, only return an empty list if this is actually a list value. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=5f2d1b06439017be5f85c250982b01a4befae508;p=licom.git If a value is not defined, only return an empty list if this is actually a list value. The problem occured when querying an unset password. --- diff --git a/lib/LiCoM/Person.pm b/lib/LiCoM/Person.pm index 887e39e..0773f5b 100644 --- a/lib/LiCoM/Person.pm +++ b/lib/LiCoM/Person.pm @@ -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}) {