diff options
author | Thierry Vignaud <tv@mageia.org> | 2012-04-19 18:31:40 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2012-04-19 18:31:40 +0000 |
commit | 175b616e24f31a12cb6e1206688f47a4c3da47bc (patch) | |
tree | ded8dd2ec559eb7e1cbe5ac6e9a5373b76b94716 /perl-install/install/pkgs.pm | |
parent | 3506dcf93707f8693a37deff097c9cf7d4a18982 (diff) | |
download | drakx-175b616e24f31a12cb6e1206688f47a4c3da47bc.tar drakx-175b616e24f31a12cb6e1206688f47a4c3da47bc.tar.gz drakx-175b616e24f31a12cb6e1206688f47a4c3da47bc.tar.bz2 drakx-175b616e24f31a12cb6e1206688f47a4c3da47bc.tar.xz drakx-175b616e24f31a12cb6e1206688f47a4c3da47bc.zip |
(_resolve_requested_and_check) fix a crash when package state is empty (mga#5487)
Diffstat (limited to 'perl-install/install/pkgs.pm')
-rw-r--r-- | perl-install/install/pkgs.pm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/perl-install/install/pkgs.pm b/perl-install/install/pkgs.pm index 77aaebf9c..266c0a5b9 100644 --- a/perl-install/install/pkgs.pm +++ b/perl-install/install/pkgs.pm @@ -279,8 +279,11 @@ sub _resolve_requested_and_check { my @l = $packages->resolve_requested($packages->{rpmdb}, $state, $requested, callback_choices => \&packageCallbackChoices, no_suggests => $::o->{no_suggests}); - my @new_ids = map { $packages->{depslist}[$_]->id } grep { $state->{selected}{$_}{suggested} } keys $state->{selected}; - @suggested_package_ids = uniq(@suggested_package_ids, @new_ids); + + if (!is_empty_hash_ref($state->{selected})) { + my @new_ids = map { $packages->{depslist}[$_]->id } grep { $state->{selected}{$_}{suggested} } keys $state->{selected}; + @suggested_package_ids = uniq(@suggested_package_ids, @new_ids); + } my $error; if (find { !exists $state->{selected}{$_} } keys %$requested) { |