X-Git-Url: http://wagnertech.de/git?p=kivitendo-erp.git;a=blobdiff_plain;f=SL%2FDB%2FHelper%2FAttrSorted.pm;fp=SL%2FDB%2FHelper%2FAttrSorted.pm;h=67c44410d2bf3303a25b857dfa614ec9ca03aef3;hp=77c5f19bc6a4b59238b5d8ec3f7050e3f948cb8e;hb=53593baa211863fbf66540cf1bcc36c8fb37257f;hpb=deb4d2dbb676d7d6f69dfe7815d6e0cb09bd4a44 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] }