@smbcloud / cli / commits / 2600ceb

Update crates/smbcloud-networking/src/network.rs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

bakul suket committed Jul 3, 2025 at 08:24 UTC 2600ceb4b2ecb90def850a60d5c2420467637a1e
1 file changed +15 -11
crates/smbcloud-networking/src/network.rs
+15 -11
@@ -23,18 +23,22 @@ pub async fn check_internet_connection() -> bool {
23 return false;
24 }
25
26 - match client.unwrap().get("https://dns.google").send().await {
27 - Ok(response) => {
28 - debug!(
29 - "Internet connection check successful: {}",
30 - response.status()
31 - );
32 - response.status().is_success()
33 - }
34 - Err(e) => {
35 - error!("Internet connection check failed: {:?}", e);
36 - false
26 + if let Ok(client) = client {
27 + match client.get("https://dns.google").send().await {
28 + Ok(response) => {
29 + debug!(
30 + "Internet connection check successful: {}",
31 + response.status()
32 + );
33 + response.status().is_success()
34 + }
35 + Err(e) => {
36 + error!("Internet connection check failed: {:?}", e);
37 + false
38 + }
39 }
40 + } else {
41 + false
42 }
43 }
44