aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.rs3
1 files changed, 2 insertions, 1 deletions
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([