Skip to content

Commit

Permalink
protect against empty data-mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
maaikelimper committed Oct 18, 2024
1 parent 22c15a5 commit a37a67d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions wis2box-management/wis2box/data_mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ def validate_and_load(path: str,
msg = f'Could not match {path} to dataset, path should include one of the following: {options}' # noqa
raise ValueError(msg)

if 'plugins' not in data_mappings[metadata_id]:
msg = f'No plugins defined in data-mappings for metadata_id={metadata_id}'
LOGGER.error(msg)
raise ValueError(msg)
plugins = data_mappings[metadata_id]['plugins']

if file_type is None:
Expand Down

0 comments on commit a37a67d

Please sign in to comment.