diff --git a/pkgtool.pm b/pkgtool.pm index 871332b..bdf9f50 100644 --- a/pkgtool.pm +++ b/pkgtool.pm @@ -1361,6 +1361,12 @@ sub sort_package ($$) { my ($a, $b) = @_; + if (! defined $a) { + return 0 unless defined $b; + return 1; + } + return -1 unless defined $b; + my $auninst = $$a{Uninstall}; my $aquninst = $$a{QUninstall}; $auninst = $aquninst if defined $aquninst; @@ -1368,12 +1374,6 @@ sub sort_package ($$) my $bquninst = $$b{QUninstall}; $buninst = $aquninst if defined $bquninst; - if (! defined $a) { - return 0 unless defined $b; - return 1; - } - return -1 unless defined $b; - my $amsi = $auninst =~ /msiexec/io; my $bmsi = $buninst =~ /msiexec/io; if (! $amsi) {