From e7663671a9a3402c7ee53f81f3f6949a573c17da Mon Sep 17 00:00:00 2001 From: Max Kanat-Alexander Date: Mon, 24 May 2010 20:19:12 -0700 Subject: "part" can return "undef" for a list, so sometimes $has_deps or $no_deps in Bugzilla::Object::_sort_by_deps were undef. https://bugzilla.mozilla.org/show_bug.cgi?id=567303 --- Bugzilla/Object.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Bugzilla/Object.pm') diff --git a/Bugzilla/Object.pm b/Bugzilla/Object.pm index 626de8f9a..ba5b82f9f 100644 --- a/Bugzilla/Object.pm +++ b/Bugzilla/Object.pm @@ -525,13 +525,13 @@ sub _sort_by_dep { # For fields with no dependencies, we sort them alphabetically, # so that validation always happens in a consistent order. # Fields with no dependencies come at the start of the list. - my @result = sort @$no_deps; + my @result = sort @{ $no_deps || [] }; # Fields with dependencies all go at the end of the list, and if # they have dependencies on *each other*, then they have to be # sorted properly. We go through $has_deps in sorted order to be # sure that fields always validate in a consistent order. - foreach my $field (sort @$has_deps) { + foreach my $field (sort @{ $has_deps || [] }) { if (!grep { $_ eq $field } @result) { _insert_dep_field($field, $has_deps, $dependencies, \@result); } -- cgit v1.2.3-24-g4f1b