Merge branch 'master' into topic/constructor_rewrite
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / DBIHacks.pm
index ec6a32f..9f2a623 100644 (file)
@@ -84,7 +84,7 @@ sub _adjust_select_args_for_complex_prefetch {
   # bring over all non-collapse-induced order_by into the inner query (if any)
   # the outer one will have to keep them all
   delete $inner_attrs->{order_by};
-  if (my $ord_cnt = @{$outer_attrs->{order_by}} - @{$outer_attrs->{_collapse_order_by}} ) {
+  if (my $ord_cnt = @{$outer_attrs->{order_by}} - @{$outer_attrs->{_collapse_order_by}||[]} ) {
     $inner_attrs->{order_by} = [
       @{$outer_attrs->{order_by}}[ 0 .. $ord_cnt - 1]
     ];