default balance to zero instead of panicing
This commit is contained in:
parent
89961331af
commit
c818a8fcd7
@ -1116,8 +1116,8 @@ impl Web3ProxyApp {
|
|||||||
.filter(balance::Column::UserId.eq(user_model.id))
|
.filter(balance::Column::UserId.eq(user_model.id))
|
||||||
.one(db_replica.conn())
|
.one(db_replica.conn())
|
||||||
.await?
|
.await?
|
||||||
.expect("related balance")
|
.map(|x| x.available_balance)
|
||||||
.available_balance;
|
.unwrap_or_default();
|
||||||
|
|
||||||
let user_tier_model =
|
let user_tier_model =
|
||||||
user_tier::Entity::find_by_id(user_model.user_tier_id)
|
user_tier::Entity::find_by_id(user_model.user_tier_id)
|
||||||
|
Loading…
Reference in New Issue
Block a user