bids-standard / legacy-validator

Validator for the Brain Imaging Data Structure
https://bids-standard.github.io/legacy-validator/
MIT License
186 stars 111 forks source link

fix(summary): Verify context.json is an object before looking up keys #2029

Closed effigies closed 4 months ago

effigies commented 4 months ago

When a JSON file is empty (e.g., https://openneuro.org/datasets/ds003404/versions/1.0.0/file-display/sub-C39:fmap:sub-C39_dir-PA_run-1_epi.json), the context.json object does not get populated. Parsing JSON could also theoretically drop in any JSON data structure, so this checks that it is an object before trying to look up TaskName.

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 87.35%. Comparing base (93868ab) to head (f2bab87).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2029 +/- ## ========================================== + Coverage 85.75% 87.35% +1.59% ========================================== Files 91 132 +41 Lines 3785 6327 +2542 Branches 1218 1528 +310 ========================================== + Hits 3246 5527 +2281 - Misses 453 709 +256 - Partials 86 91 +5 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.