Skip to content

Commit

Permalink
Fix webhook_url can be none
Browse files Browse the repository at this point in the history
  • Loading branch information
PredaaA committed Oct 25, 2023
1 parent 161645f commit 3f3ba75
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/discord_log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ pub fn discord_log(
let message: String = message.into();

tokio::spawn(async move {
let webhook_url = CONFIG.webhook_url.clone().unwrap();
let binding = "".to_string();
let webhook_url = CONFIG.webhook_url.as_ref().unwrap_or(&binding);
if webhook_url.is_empty() {
return;
}
Expand Down

0 comments on commit 3f3ba75

Please sign in to comment.