From: Sven Schöling Date: Mon, 31 Jul 2017 13:40:15 +0000 (+0200) Subject: ShippedQty: Chaining bei Aufruf mit leerem Array X-Git-Tag: release-3.5.4~928 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=96ddb9322d73a00236a566e9764094c29ff80297;p=kivitendo-erp.git ShippedQty: Chaining bei Aufruf mit leerem Array --- 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);