fix: Avoid exception on broken captures

pull/526/head
Raphaël Vinot 2022-09-26 20:50:42 +02:00
parent df4a37ea12
commit 159d444b20
1 changed files with 1 additions and 1 deletions

View File

@ -470,7 +470,7 @@ def modules(tree_uuid: str):
@app.route('/tree/<string:tree_uuid>/redirects', methods=['GET']) @app.route('/tree/<string:tree_uuid>/redirects', methods=['GET'])
def redirects(tree_uuid: str): def redirects(tree_uuid: str):
cache = lookyloo.capture_cache(tree_uuid) cache = lookyloo.capture_cache(tree_uuid)
if not cache: if not cache or not hasattr(cache, 'redirects'):
return Response('Not available.', mimetype='text/text') return Response('Not available.', mimetype='text/text')
if not cache.redirects: if not cache.redirects:
return Response('No redirects.', mimetype='text/text') return Response('No redirects.', mimetype='text/text')