mirror of https://github.com/MISP/misp-modules
fix: Grouped two if conditions to avoid issues with variable unassigned if the second condition is not true
parent
b1ae8deb6b
commit
6d19549184
|
@ -23,11 +23,7 @@ def handler(q=False):
|
|||
r = requests.post(hashddapi_url, data={'hash': v})
|
||||
if r.status_code == 200:
|
||||
state = json.loads(r.text)
|
||||
if state:
|
||||
if state.get(v):
|
||||
summary = state[v]['known_level']
|
||||
else:
|
||||
summary = 'Unknown hash'
|
||||
summary = state[v]['known_level'] if state and state.get(v) else 'Unknown hash'
|
||||
else:
|
||||
misperrors['error'] = '{} API not accessible'.format(hashddapi_url)
|
||||
return misperrors['error']
|
||||
|
|
Loading…
Reference in New Issue