summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fatcat_scholar/sim_pipeline.py4
-rw-r--r--fatcat_scholar/work_pipeline.py4
2 files changed, 6 insertions, 2 deletions
diff --git a/fatcat_scholar/sim_pipeline.py b/fatcat_scholar/sim_pipeline.py
index 4315e70..c96681a 100644
--- a/fatcat_scholar/sim_pipeline.py
+++ b/fatcat_scholar/sim_pipeline.py
@@ -64,7 +64,9 @@ class SimPipeline():
leaf_index = dict()
leaf_list = []
- assert 'page_numbers' in issue_meta
+ if not 'page_numbers' in issue_meta:
+ # TODO: warn
+ return None
for entry in issue_meta['page_numbers'].get('pages', []):
page_num = entry['pageNumber']
leaf_index[entry['leafNum']] = page_num
diff --git a/fatcat_scholar/work_pipeline.py b/fatcat_scholar/work_pipeline.py
index 9ce72b1..5bfc1b6 100644
--- a/fatcat_scholar/work_pipeline.py
+++ b/fatcat_scholar/work_pipeline.py
@@ -166,7 +166,9 @@ class WorkPipeline():
leaf_index = dict()
leaf_list = []
- assert 'page_numbers' in issue_meta
+ if not 'page_numbers' in issue_meta:
+ # TODO: warn
+ return None
for entry in issue_meta['page_numbers'].get('pages', []):
page_num = entry['pageNumber']
leaf_index[entry['leafNum']] = page_num