From 5f2d1b06439017be5f85c250982b01a4befae508 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Sun, 11 Jun 2006 16:24:47 +0200 Subject: [PATCH] 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. --- lib/LiCoM/Person.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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}) { -- 2.11.0