mirror of https://github.com/MISP/PyMISP
Fix KeyError when no results in time period
Fix a KeyError when no results were found for the specified time period.pull/3/head
parent
205baa2f65
commit
b5acf414e9
|
@ -18,8 +18,12 @@ def init(url, key):
|
|||
def download_last(m, last, out=None):
|
||||
result = m.download_last(last)
|
||||
if out is None:
|
||||
if 'response' in result:
|
||||
for e in result['response']:
|
||||
print(json.dumps(e) + '\n')
|
||||
else:
|
||||
print('No results for that time period')
|
||||
exit(0)
|
||||
else:
|
||||
with open(out, 'w') as f:
|
||||
for e in result['response']:
|
||||
|
|
Loading…
Reference in New Issue