]> wagnertech.de Git - kivitendo-erp.git/blobdiff - SL/DB/Helper/AttrSorted.pm
Merge branch 'b-3.6.1' of ../kivitendo-erp_20220811
[kivitendo-erp.git] / SL / DB / Helper / AttrSorted.pm
index 77c5f19bc6a4b59238b5d8ec3f7050e3f948cb8e..67c44410d2bf3303a25b857dfa614ec9ca03aef3 100644 (file)
@@ -29,7 +29,7 @@ sub _make_sorted {
 
     croak 'not an accessor' if @_ > 1;
 
 
     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] }
     return [
       map  { $_->[1] }
       sort { $a->[0] <=> $b->[0] }