Skip to content

Commit

Permalink
protect against empty data-mappings (#795)
Browse files Browse the repository at this point in the history
* protect against empty data-mappings

* flake8
  • Loading branch information
maaikelimper authored Oct 18, 2024
1 parent 22c15a5 commit 25faa39
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}' # noqa
LOGGER.error(msg)
raise ValueError(msg)
plugins = data_mappings[metadata_id]['plugins']

if file_type is None:
Expand Down

0 comments on commit 25faa39

Please sign in to comment.