From 6b89ba35e8cba27250826da9c64d2a20706caca7 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 30 Aug 2019 15:00:03 +0200 Subject: [PATCH] AttrSorted-Helfer: Warnungen wegen nicht initialisierten Werten vermeiden Durch Tests getriggert, konkret: durch t/controllers/csvimport/parts.t --- SL/DB/Helper/AttrSorted.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SL/DB/Helper/AttrSorted.pm b/SL/DB/Helper/AttrSorted.pm index 77c5f19bc..67c44410d 100644 --- a/SL/DB/Helper/AttrSorted.pm +++ b/SL/DB/Helper/AttrSorted.pm @@ -29,7 +29,7 @@ sub _make_sorted { croak 'not an accessor' if @_ > 1; - my $next_position = (max map { $_->$position_sub // 0 } @{ $self->$unsorted_sub }) + 1; + my $next_position = ((max map { $_->$position_sub // 0 } @{ $self->$unsorted_sub }) // 0) + 1; return [ map { $_->[1] } sort { $a->[0] <=> $b->[0] } -- 2.20.1