]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
"part" can return "undef" for a list, so sometimes $has_deps or $no_deps
authorMax Kanat-Alexander <mkanat@bugzilla.org>
Tue, 25 May 2010 03:19:12 +0000 (20:19 -0700)
committerMax Kanat-Alexander <mkanat@bugzilla.org>
Tue, 25 May 2010 03:19:12 +0000 (20:19 -0700)
in Bugzilla::Object::_sort_by_deps were undef.

https://bugzilla.mozilla.org/show_bug.cgi?id=567303

Bugzilla/Object.pm

index 626de8f9ac24990d13355e70a4279e7743bd5aa6..ba5b82f9fdb84ebb9766f3ee69787602bc3ca750 100644 (file)
@@ -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);
         }