From d8559071bff2c32e29f70441a8de3c7a729812e8 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 25 Nov 2014 13:51:10 +0100 Subject: [PATCH] SL::DB::CustomVariable->value: undef anstelle von 0 wenn ref.Objekt nicht existiert --- SL/DB/CustomVariable.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SL/DB/CustomVariable.pm b/SL/DB/CustomVariable.pm index 7e6b50080..4be4b6ef2 100644 --- a/SL/DB/CustomVariable.pm +++ b/SL/DB/CustomVariable.pm @@ -64,17 +64,17 @@ sub value { require SL::DB::Customer; my $id = int($self->number_value); - return $id ? SL::DB::Customer->new(id => $id)->load() : 0; + return $id ? SL::DB::Customer->new(id => $id)->load() : undef; } elsif ( $type eq 'vendor' ) { require SL::DB::Vendor; my $id = int($self->number_value); - return $id ? SL::DB::Vendor->new(id => $id)->load() : 0; + return $id ? SL::DB::Vendor->new(id => $id)->load() : undef; } elsif ( $type eq 'part' ) { require SL::DB::Part; my $id = int($self->number_value); - return $id ? SL::DB::Part->new(id => $id)->load() : 0; + return $id ? SL::DB::Part->new(id => $id)->load() : undef; } goto &text_value; # text, textfield, date and select -- 2.20.1