diff options
Diffstat (limited to 'lib/network')
-rw-r--r-- | lib/network/connection/wireless.pm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/network/connection/wireless.pm b/lib/network/connection/wireless.pm index 4653b79..20ebd8d 100644 --- a/lib/network/connection/wireless.pm +++ b/lib/network/connection/wireless.pm @@ -704,12 +704,13 @@ sub connect { if ($self->{control}{roaming}) { refresh_roaming_ids($self); my $network = $self->get_selected_network; - if ($network && defined $network->{id}) { + my $network_id = $network->{id} if $network && defined $network->{id}; + if (defined $network_id) { if ($net->{monitor}) { - eval { $net->{monitor}->select_network($network->{id}) }; + eval { $net->{monitor}->select_network($network_id) }; return !$@; } else { - run_program::run('/usr/sbin/wpa_cli', 'select_network', $network->{id}); + run_program::run('/usr/sbin/wpa_cli', 'select_network', $network_id); } } } |