fix: #137 when a CVE is not found, a return message is given

pull/144/head
Alexandre Dulaunoy 5 years ago
parent 2f6406b1e5
commit 03baa0b84d
No known key found for this signature in database
GPG Key ID: 9E2CD4944E6CBCD
  1. 7
      misp_modules/modules/expansion/cve.py

@ -19,8 +19,11 @@ def handler(q=False):
r = requests.get(cveapi_url + request.get('vulnerability'))
if r.status_code == 200:
vulnerability = json.loads(r.text)
if vulnerability.get('summary'):
summary = vulnerability['summary']
if vulnerability:
if vulnerability.get('summary'):
summary = vulnerability['summary']
else:
summary = 'Non existing CVE'
else:
misperrors['error'] = 'cve.circl.lu API not accessible'
return misperrors['error']

Loading…
Cancel
Save