From 80eeefd62e418cf2e1cf96dc7a87fde1e34b49a2 Mon Sep 17 00:00:00 2001 From: Roland Sherwin Date: Tue, 21 May 2024 21:17:52 +0530 Subject: [PATCH] fix(auditor): discord id cannot be empty --- sn_auditor/src/routes.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sn_auditor/src/routes.rs b/sn_auditor/src/routes.rs index f64d5ddd36..9c217ea612 100644 --- a/sn_auditor/src/routes.rs +++ b/sn_auditor/src/routes.rs @@ -90,6 +90,8 @@ pub(crate) fn add_participant( return Ok( Response::from_string("discord_id cannot be more than 32 chars").with_status_code(400), ); + } else if discord_id.chars().count() == 0 { + return Ok(Response::from_string("discord_id cannot be empty").with_status_code(400)); } if let Err(err) = track_new_participant(dag, discord_id.to_owned()) {