diff --git a/source/rate/rate.interceptor.ts b/source/rate/rate.interceptor.ts index 1a18a51..20b47f9 100644 --- a/source/rate/rate.interceptor.ts +++ b/source/rate/rate.interceptor.ts @@ -23,7 +23,7 @@ export class RateInterceptor implements NestInterceptor { */ public async intercept(context: ExecutionContext, next: CallHandler): Promise> { const options: RateLimitOptions = this.reflector.get(AppMetadataKey.RATE_LIMIT_OPTIONS, context.getHandler()); - const { limit: optionsLimit, key: optionsKey, window: optionsWindow } = options; + const { limit: optionsLimit, key: optionsKey, window: optionsWindow } = options || { }; const limit = typeof optionsLimit === 'function' ? optionsLimit(this.contextService)