From a6bcf1fce789ce32541ce28c250080f95119f796 Mon Sep 17 00:00:00 2001 From: arkanoider Date: Mon, 23 Dec 2024 15:47:41 +0100 Subject: [PATCH] Fix: improved checks in rate order --- src/app/rate_user.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app/rate_user.rs b/src/app/rate_user.rs index 962c748..84f4661 100644 --- a/src/app/rate_user.rs +++ b/src/app/rate_user.rs @@ -91,10 +91,14 @@ pub async fn update_user_reputation_action( // Find the counterpart public key if message_sender == buyer { - counterpart = order.master_seller_pubkey.unwrap(); + counterpart = order + .master_seller_pubkey + .ok_or_else(|| Error::msg("Missing master seller pubkey"))?; buyer_rating = true; } else if message_sender == seller { - counterpart = order.master_buyer_pubkey.unwrap(); + counterpart = order + .master_buyer_pubkey + .ok_or_else(|| Error::msg("Missing master buyer pubkey"))?; seller_rating = true; };