diff options
| author | Emīls Piņķis <emils@mullvad.net> | 2019-01-07 14:20:03 +0000 |
|---|---|---|
| committer | Emīls Piņķis <emils@mullvad.net> | 2019-01-09 12:05:18 +0000 |
| commit | 6fef2055d04771432d01e6b98b6200d1ed17d100 (patch) | |
| tree | 5f2f6e44acd9f9e8a2557c6c235a5be1afe4319a /mullvad-cli/src/cmds | |
| parent | 74da64ba1e1f0dda1ac94dfdf5eead7a41576e68 (diff) | |
| download | mullvadvpn-6fef2055d04771432d01e6b98b6200d1ed17d100.tar.xz mullvadvpn-6fef2055d04771432d01e6b98b6200d1ed17d100.zip | |
Further improve get_current_location RPC
Diffstat (limited to 'mullvad-cli/src/cmds')
| -rw-r--r-- | mullvad-cli/src/cmds/status.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mullvad-cli/src/cmds/status.rs b/mullvad-cli/src/cmds/status.rs index 26b2cf7f06..9c022a38d8 100644 --- a/mullvad-cli/src/cmds/status.rs +++ b/mullvad-cli/src/cmds/status.rs @@ -65,7 +65,13 @@ fn print_blocked_reason(reason: &BlockReason) { } fn print_location(rpc: &mut DaemonRpcClient) -> Result<()> { - let location = rpc.get_current_location()?; + let location = match rpc.get_current_location()? { + Some(loc) => loc, + None => { + println!("Location data unavailable"); + return Ok(()); + } + }; let city_and_country = if let Some(city) = location.city { format!("{}, {}", city, location.country) } else { |
