Skip to content

Commit 525163b

Browse files
committed
Log a warning if an unknown modality is blacklisted
1 parent 070a31d commit 525163b

File tree

1 file changed

+7
-2
lines changed
  • bids-validator/src/validators

1 file changed

+7
-2
lines changed

bids-validator/src/validators/bids.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { type BIDSContext, BIDSContextDataset } from '../schema/context.ts'
1818
import type { parseOptions } from '../setup/options.ts'
1919
import { hedValidate } from './hed.ts'
2020
import { citationValidate } from './citation.ts'
21+
import { logger } from '../utils/logger.ts'
2122

2223
/**
2324
* Ordering of checks to apply
@@ -121,8 +122,12 @@ export async function validate(
121122
// Map blacklisted datatypes back to the modality that generated them
122123
for (const modality of options.blacklistModalities) {
123124
const datatypes = modalitiesRule[modality.toLowerCase()]?.datatypes as string[]
124-
for (const datatype of datatypes) {
125-
blacklistedDatatypes.set(datatype, modality)
125+
if (datatypes) {
126+
for (const datatype of datatypes) {
127+
blacklistedDatatypes.set(datatype, modality)
128+
}
129+
} else {
130+
logger.warn(`Attempted to blacklist unknown modality: ${modality}`)
126131
}
127132
}
128133
}

0 commit comments

Comments
 (0)