Skip to content

Commit

Permalink
fix: handle error if security scopes is invalid (#2113)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexVarchuk authored Aug 2, 2022
1 parent cf4642e commit 428fd69
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/SecurityRequirement/SecurityRequirement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function getRequiredScopes(id: string, securities: SecurityRequirementModel[]):
let schemesLength = security.schemes.length;
while (schemesLength--) {
const scheme = security.schemes[schemesLength];
if (scheme.id === id) {
if (scheme.id === id && Array.isArray(scheme.scopes)) {
allScopes.push(...scheme.scopes);
}
}
Expand Down

0 comments on commit 428fd69

Please sign in to comment.