Skip to content

Commit

Permalink
hotifx:
Browse files Browse the repository at this point in the history
import edge_db crashes process (thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', src/safe_db/db.rs:45:61
)
  • Loading branch information
jaensen committed Aug 14, 2024
1 parent 60fa1b1 commit 7d704fb
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/safe_db/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
Expand Down

0 comments on commit 7d704fb

Please sign in to comment.