Skip to content

Commit

Permalink
fix: Check if rule.entities exists before accessing keys
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed May 23, 2024
1 parent 2e84f81 commit 9822199
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bids-validator/src/validators/filenameIdentify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ function entitiesExtensionsInRule(
): boolean {
const rule = schema[path]
const fileEntities = Object.keys(context.entities)
const ruleEntities = Object.keys(rule.entities).map((key) =>
const ruleEntities = rule.entities ? Object.keys(rule.entities).map((key) =>
lookupEntityLiteral(key, schema),
)
) : []
const extInRule =
!rule.extensions ||
(rule.extensions && rule.extensions.includes(context.extension))
Expand Down

0 comments on commit 9822199

Please sign in to comment.