From ca486f05ca630080f56d215f28bdd14a6cf7ab83 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Thu, 9 Mar 2023 12:13:41 +0100 Subject: stoopid --- src/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 855cb39..d16e03c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -379,7 +379,8 @@ impl State { } } endpoints.sort(); - if let Some(endpoint) = endpoints.get(i % endpoints.len()) { + if !endpoints.is_empty() { + let endpoint = endpoints[i % endpoints.len()]; info!("Configure {} with endpoint {}", peer.pubkey, endpoint.0); Command::new("wg") .args([ -- cgit v1.2.3