summaryrefslogtreecommitdiffhomepage
path: root/mullvad-cli/src/cmds
diff options
context:
space:
mode:
authorEmīls Piņķis <emils@mullvad.net>2019-01-07 14:20:03 +0000
committerEmīls Piņķis <emils@mullvad.net>2019-01-09 12:05:18 +0000
commit6fef2055d04771432d01e6b98b6200d1ed17d100 (patch)
tree5f2f6e44acd9f9e8a2557c6c235a5be1afe4319a /mullvad-cli/src/cmds
parent74da64ba1e1f0dda1ac94dfdf5eead7a41576e68 (diff)
downloadmullvadvpn-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.rs8
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 {