From 790dd4fd363aaa4a2caf64db12a348f1d2060d5f Mon Sep 17 00:00:00 2001 From: "sandipsamal117@gmail.com" Date: Wed, 11 Dec 2024 10:50:33 -0500 Subject: [PATCH] null check on input data --- reg_chxr.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/reg_chxr.py b/reg_chxr.py index 5fdfbc9..e5e31a8 100644 --- a/reg_chxr.py +++ b/reg_chxr.py @@ -23,7 +23,7 @@ logger.remove() logger.add(sys.stderr, format=logger_format) -__version__ = '1.0.1' +__version__ = '1.0.2' DISPLAY_TITLE = r""" _ _ @@ -105,6 +105,10 @@ def main(options: Namespace, inputdir: Path, outputdir: Path): with open(input_file, 'r') as file: data = json.load(file) + # null check + if len(data) == 0: + raise Exception(f"Cannot verify registration for empty pacs data.") + # for each individual series, check if total file count matches total file registered for series in data: pacs_search_params = sanitize_for_cube(series)