Skip to content

Commit 9e8d3fc

Browse files
committed
fix: add guard clause if PathsObject is undefined
Signed-off-by: Mats Johansson <extern.mats.johansson@digg.se>
1 parent 57425d6 commit 9e8d3fc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/rulesets/DokRules.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,8 @@ export class Dok21 extends BaseRuleset {
447447
}
448448
}
449449

450-
const hasSecurityInAnyPath = (paths: PathsObject): boolean => {
450+
const hasSecurityInAnyPath = (paths: PathsObject | undefined): boolean => {
451+
if (!paths) return false;
451452
return Object.values(paths).some((pathItem: PathItemObject | undefined) => {
452453
if (!pathItem) return false;
453454

0 commit comments

Comments
 (0)