From 96ddb9322d73a00236a566e9764094c29ff80297 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Mon, 31 Jul 2017 15:40:15 +0200 Subject: [PATCH] ShippedQty: Chaining bei Aufruf mit leerem Array --- SL/Helper/ShippedQty.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SL/Helper/ShippedQty.pm b/SL/Helper/ShippedQty.pm index d89a306c7..5135823e7 100644 --- a/SL/Helper/ShippedQty.pm +++ b/SL/Helper/ShippedQty.pm @@ -104,8 +104,6 @@ sub calculate { die 'Need exactly one argument, either id, object or arrayref of ids or objects.' unless 2 == @_; - return $self if !$data || ('ARRAY' eq ref $data && !@$data); - $self->normalize_input($data); return $self unless @{ $self->oe_ids }; @@ -235,6 +233,8 @@ sub write_to { sub write_to_objects { my ($self) = @_; + return unless @{ $self->oe_ids }; + die 'Can only use write_to_objects, when calculate was called with objects. Use write_to instead.' unless $self->objects_or_ids; $self->write_to($self->objects); -- 2.20.1