From d2d5a03ca7a7f457fbb238784153087b78536580 Mon Sep 17 00:00:00 2001 From: Marion Date: Fri, 8 Mar 2024 09:36:16 -0800 Subject: [PATCH] add try catch --- query_server/query_operations.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/query_server/query_operations.py b/query_server/query_operations.py index 9637d2e..243572a 100644 --- a/query_server/query_operations.py +++ b/query_server/query_operations.py @@ -95,8 +95,12 @@ def get_summary_stats(donors, headers): treatment_type_count = {} for treatment in treatments: if treatment["submitter_donor_id"] in donors_by_id: - for treatment_type in treatment["treatment_type"]: - add_or_increment(treatment_type_count, treatment_type) + try: + for treatment_type in treatment["treatment_type"]: + add_or_increment(treatment_type_count, treatment_type) + except TypeError as e: + print(e) + pass return { 'age_at_diagnosis': age_at_diagnosis,