From 8c5989d4655179f9d3f2c1818e87d6789f315002 Mon Sep 17 00:00:00 2001 From: Stefan Stammberger Date: Tue, 28 Sep 2021 21:10:51 +0200 Subject: [PATCH] fix: crash when an ext doesn't have static files --- lnbits/app.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lnbits/app.py b/lnbits/app.py index 288caa5ba..b0289b932 100644 --- a/lnbits/app.py +++ b/lnbits/app.py @@ -96,9 +96,10 @@ def register_routes(app: FastAPI) -> None: ext_module = importlib.import_module(f"lnbits.extensions.{ext.code}") ext_route = getattr(ext_module, f"{ext.code}_ext") - ext_statics = getattr(ext_module, f"{ext.code}_static_files") - for s in ext_statics: - app.mount(s["path"], s["app"], s["name"]) + if hasattr(ext_module, f"{ext.code}_static_files"): + ext_statics = getattr(ext_module, f"{ext.code}_static_files") + for s in ext_statics: + app.mount(s["path"], s["app"], s["name"]) app.include_router(ext_route) except Exception as e: