fix: Considering the case of empty results

pull/340/head
chrisr3d 2019-10-08 15:49:09 +02:00
parent 8bcb630340
commit b560347d5d
No known key found for this signature in database
GPG Key ID: 6BBED1B63A6D639F
1 changed files with 2 additions and 0 deletions

View File

@ -100,6 +100,8 @@ def handler(q=False):
except Exception:
continue
result = "\n".join(["{}: {}".format(l, " - ".join(i)) for l, i in zip(listed, info)])
if not result:
return {'error': 'No data found by querying known RBLs'}
return {'results': [{'types': mispattributes.get('output'), 'values': result}]}