From 273b5e046f1dab732ece657a756ada58d7669b9d Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 9 Dec 2014 10:46:44 +0100 Subject: [PATCH] =?utf8?q?CustomerVendorPicker:=20ref($value)=20nur=20pr?= =?utf8?q?=C3=BCfen,=20wenn=20es=20tats=C3=A4chlich=20ein=20Objekt=20ist?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit …und nicht schlicht die ID eines Objektes. --- SL/Presenter/CustomerVendor.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SL/Presenter/CustomerVendor.pm b/SL/Presenter/CustomerVendor.pm index 4a3702970..9045cda0c 100644 --- a/SL/Presenter/CustomerVendor.pm +++ b/SL/Presenter/CustomerVendor.pm @@ -40,7 +40,7 @@ sub customer_vendor_picker { my ($self, $name, $value, %params) = @_; croak 'Unknown "type" parameter' unless $params{type} =~ m{^(?:customer|vendor)$}; - croak 'Unknown value class' if $value && (ref($value) !~ m{^SL::DB::(?:Customer|Vendor)$}); + croak 'Unknown value class' if $value && ref($value) && (ref($value) !~ m{^SL::DB::(?:Customer|Vendor)$}); if ($value && !ref $value) { my $class = $params{type} eq 'customer' ? 'SL::DB::Manager::Customer' : 'SL::DB::Manager::Vendor'; -- 2.20.1