fix: [variodbs] Fixed indentation issue

- if `exploit_results` is empty, we should not go
  any further in the query for next values exploit
  results
pull/590/head
Christian Studer 2022-10-27 09:50:24 +02:00
parent 5526c2c195
commit e18ac776bb
No known key found for this signature in database
GPG Key ID: 6BBED1B63A6D639F
1 changed files with 9 additions and 9 deletions

View File

@ -191,15 +191,15 @@ def handler(q=False):
if exploit_results: if exploit_results:
parser.parse_exploit_information(exploit_results['results']) parser.parse_exploit_information(exploit_results['results'])
empty = False empty = False
if exploit_results['next'] is not None: if exploit_results['next'] is not None:
while(1): while(1):
exploit_results = requests.get(exploit_results['next'], headers=headers) exploit_results = requests.get(exploit_results['next'], headers=headers)
if exploit_results.status_code != 200: if exploit_results.status_code != 200:
break break
exploit_results = exploit_results.json() exploit_results = exploit_results.json()
parser.parse_exploit_information(exploit_results['results']) parser.parse_exploit_information(exploit_results['results'])
if exploit_results['next'] is None: if exploit_results['next'] is None:
break break
else: else:
return {'error': 'Error while querying the variotdbs API.'} return {'error': 'Error while querying the variotdbs API.'}
if empty: if empty: