Skip to content

Commit f241cd3

Browse files
committed
cleanup to fix nonetype error when fixing csv format issue
1 parent 10e025a commit f241cd3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/client/delphi_epidata.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,11 @@ def _request(params):
7272
long and returns a 414.
7373
"""
7474
try:
75-
if "format" in params and params["format"]=="csv":
76-
return Epidata._request_with_retry(params).text
77-
return Epidata._request_with_retry(params).json()
75+
result = Epidata._request_with_retry(params)
76+
if params is not None and "format" in params and params["format"]=="csv":
77+
return result.text
78+
else:
79+
return result.json()
7880
except Exception as e:
7981
return {'result': 0, 'message': 'error: ' + str(e)}
8082

0 commit comments

Comments
 (0)