From 7d704fb0f9b0abce73c2ecc110c2d2a4dfb62914 Mon Sep 17 00:00:00 2001 From: daniel <4954577+jaensen@users.noreply.github.com> Date: Wed, 14 Aug 2024 16:26:14 +0200 Subject: [PATCH] hotifx: import edge_db crashes process (thread '' panicked at 'called `Option::unwrap()` on a `None` value', src/safe_db/db.rs:45:61 ) --- src/safe_db/db.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/safe_db/db.rs b/src/safe_db/db.rs index dfe3f38..9a17f45 100644 --- a/src/safe_db/db.rs +++ b/src/safe_db/db.rs @@ -42,10 +42,15 @@ impl DB { continue; } - let receiver_safe = self.safes.get(send_to).unwrap(); - if receiver_safe.organization { - //println!("user {} can send {} token to orga {}", user, safe.token_address, send_to); - organization_accepted_tokens.entry(safe.token_address).or_default().insert(*send_to); + if let Some(receiver_safe) = self.safes.get(send_to) { + if receiver_safe.organization { + // println!("user {} can send {} token to orga {}", user, safe.token_address, send_to); + organization_accepted_tokens.entry(safe.token_address).or_default().insert(*send_to); + } + } else { + // Skip this round if there's no receiver_safe + println!("Couldn't find a 'receiver_safe' for {}", send_to); + continue; } } }