From a42025577e925d5d5fb02c49838feafec3e5962c Mon Sep 17 00:00:00 2001 From: Joakim Hulthe Date: Mon, 24 Oct 2022 18:25:24 +0200 Subject: [PATCH] Fix div by 0 error in info task --- backend/src/tasks/info.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/src/tasks/info.rs b/backend/src/tasks/info.rs index 096dcd7..b0d28c2 100644 --- a/backend/src/tasks/info.rs +++ b/backend/src/tasks/info.rs @@ -35,6 +35,10 @@ pub async fn info_task(state: &State) { let mut collectors = collectors.into_boxed_slice(); + if collectors.is_empty() { + return; + } + let server_message = &state.server_message; let collectors_len = collectors.len();