diff --git a/src/app/rate_user.rs b/src/app/rate_user.rs index b0697e75..bf207306 100644 --- a/src/app/rate_user.rs +++ b/src/app/rate_user.rs @@ -121,6 +121,12 @@ pub async fn update_user_reputation_action( let rating; if let Some(Payload::RatingUser(v)) = msg.get_inner_message_kind().payload.to_owned() { + if !(MIN_RATING..=MAX_RATING).contains(&v) { + return Err(Error::msg(format!( + "Rating must be between {} and {}", + MIN_RATING, MAX_RATING + ))); + } rating = v; } else { return Err(Error::msg("No rating present")); diff --git a/src/util.rs b/src/util.rs index a64d0048..6645c077 100644 --- a/src/util.rs +++ b/src/util.rs @@ -268,7 +268,9 @@ pub async fn send_dm( ); if let Ok(client) = get_nostr_client() { - let _ = client.send_event(event).await; + if let Err(e) = client.send_event(event).await { + error!("Failed to send event: {}", e); + } } Ok(())