Fix unwrap panic on trying to access rate limits

This commit is contained in:
bitfl0wer 2023-08-07 14:56:10 +02:00
parent 1cc29540d0
commit 07818b2cd6
1 changed files with 3 additions and 0 deletions

View File

@ -237,6 +237,9 @@ impl ChorusRequest {
/// reset to the rate limit limit.
/// 2. The remaining rate limit is decreased by 1.
fn update_rate_limits(user: &mut UserMeta, limit_type: &LimitType, response_was_err: bool) {
if user.belongs_to.borrow().limits_information.is_none() {
return;
}
let instance_dictated_limits = [
&LimitType::AuthLogin,
&LimitType::AuthRegister,