diff --git a/app/__init__.py b/app/__init__.py index c3a1fa5..e590f7e 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -82,14 +82,6 @@ def create_app(): if cdclient is not None: cdclient.close() - # @app.errorhandler(Exception) - # def handle_exception(e): - # app.logger.error(e) - # # pass through HTTP errors - # if isinstance(e, HTTPException): - # return e - # # now you're handling non-HTTP exceptions only - # return render_template("status_codes/500.html.j2", exception=e), 500 # add the commands to flask cli app.cli.add_command(init_db) diff --git a/app/luclient.py b/app/luclient.py index 1150e74..5fcea72 100644 --- a/app/luclient.py +++ b/app/luclient.py @@ -76,7 +76,10 @@ def get_icon_lot(id): one=True )[0] - filename = filename.replace("..\\", "").replace("\\", "/") + if filename: + filename = filename.replace("..\\", "").replace("\\", "/") + else: + return redirect(url_for('luclient.unknown')) cache = f'app/cache/{filename.split(".")[0]}.png'