Fix unwrap panic on trying to access rate limits (#178)
This commit is contained in:
commit
2d7fe96eda
|
@ -237,6 +237,9 @@ impl ChorusRequest {
|
||||||
/// reset to the rate limit limit.
|
/// reset to the rate limit limit.
|
||||||
/// 2. The remaining rate limit is decreased by 1.
|
/// 2. The remaining rate limit is decreased by 1.
|
||||||
fn update_rate_limits(user: &mut UserMeta, limit_type: &LimitType, response_was_err: bool) {
|
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 = [
|
let instance_dictated_limits = [
|
||||||
&LimitType::AuthLogin,
|
&LimitType::AuthLogin,
|
||||||
&LimitType::AuthRegister,
|
&LimitType::AuthRegister,
|
||||||
|
|
Loading…
Reference in New Issue