fix sorting of columns with undef values
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 5 Jun 2010 19:58:24 +0000 (21:58 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 5 Jun 2010 19:58:24 +0000 (21:58 +0200)
lib/MojoFacets/Data.pm

index d9109cf..736ad74 100644 (file)
@@ -508,7 +508,7 @@ sub _data_sorted_by {
                }
        } map {
                [ $nr++, exists $_->{$order} ? join('', @{$_->{$order}}) : $missing ]
-       } @{ $data->{items} }
+       } grep { ref $_->{$order} eq 'ARRAY' } @{ $data->{items} }
        ;
 
        warn "sorted: $order numeric: $numeric items: ", $#sorted + 1, "\n";