Skip to content

Commit

Permalink
Merge pull request #24 from CanDIG/mshadbolt/null-error-handling
Browse files Browse the repository at this point in the history
DIG-1527: Catch error when treatment_type is null
  • Loading branch information
mshadbolt authored Mar 11, 2024
2 parents cd22b9b + d2d5a03 commit 4bd3910
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions query_server/query_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 4bd3910

Please sign in to comment.