X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class.git;a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FResultSet.pm;h=4c5b9617f6b040db282ac3a519db65692f979d27;hp=bf4b1d815ec52ad5db39de974b5fd41d17f63843;hb=ce855fffdd5cf13e9fd29ad9883ab7cbb9a7b22a;hpb=8c49ff1aa472bfc3c21f14a03411ca95893226fe diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index bf4b1d8..4c5b961 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -1972,6 +1972,8 @@ sub populate { # cruft placed in standalone method my $data = $self->_normalize_populate_args(@_); + return unless @$data; + if(defined wantarray) { my @created; foreach my $item (@$data) { @@ -2076,7 +2078,10 @@ sub _normalize_populate_args { my ($self, $arg) = @_; if (ref $arg eq 'ARRAY') { - if (ref $arg->[0] eq 'HASH') { + if (!@$arg) { + return []; + } + elsif (ref $arg->[0] eq 'HASH') { return $arg; } elsif (ref $arg->[0] eq 'ARRAY') {