From 804dc1d466391a09ab9c34de091cb8a49b0cd1fe Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Mon, 24 Nov 2008 17:26:06 +0000 Subject: rewrite package selection to avoid dereferencing empty ref --- lib/network/connection/xdsl.pm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/network/connection/xdsl.pm b/lib/network/connection/xdsl.pm index f5ca5b9..7c88dff 100644 --- a/lib/network/connection/xdsl.pm +++ b/lib/network/connection/xdsl.pm @@ -338,15 +338,16 @@ sub unload_connection { sub install_packages { my ($self, $in) = @_; - my $packages = { + my $per_type_packages = { pppoa => [ qw(ppp-pppoatm) ], pppoe => [ qw(rp-pppoe) ], pptp => [ qw(pptp-linux) ], capi => [ qw(ppp) ], - }->{$self->{protocol}}; - push @$packages, 'linux-atm' if $self->uses_atm_arp || $self->uses_atm_bridging; - if ($packages && !$in->do_pkgs->install(@$packages)) { - $in->ask_warn(N("Error"), N("Could not install the packages (%s)!", @$packages)); + }; + my @packages = @{$per_type_packages->{$self->{protocol}} || []}; + push @packages, 'linux-atm' if $self->uses_atm_arp || $self->uses_atm_bridging; + if (@packages && !$in->do_pkgs->install(@packages)) { + $in->ask_warn(N("Error"), N("Could not install the packages (%s)!", @packages)); return; } if ($self->{protocol} eq 'capi') { -- cgit v1.2.1