default balance to zero instead of panicing

This commit is contained in:
Bryan Stitt 2023-05-16 23:40:32 -07:00
parent 89961331af
commit c818a8fcd7

@ -1116,8 +1116,8 @@ impl Web3ProxyApp {
.filter(balance::Column::UserId.eq(user_model.id))
.one(db_replica.conn())
.await?
.expect("related balance")
.available_balance;
.map(|x| x.available_balance)
.unwrap_or_default();
let user_tier_model =
user_tier::Entity::find_by_id(user_model.user_tier_id)