fix: crash when an ext doesn't have static files
This commit is contained in:
parent
ca5ee4ed4f
commit
8c5989d465
1 changed files with 4 additions and 3 deletions
|
|
@ -96,9 +96,10 @@ def register_routes(app: FastAPI) -> None:
|
||||||
ext_module = importlib.import_module(f"lnbits.extensions.{ext.code}")
|
ext_module = importlib.import_module(f"lnbits.extensions.{ext.code}")
|
||||||
ext_route = getattr(ext_module, f"{ext.code}_ext")
|
ext_route = getattr(ext_module, f"{ext.code}_ext")
|
||||||
|
|
||||||
ext_statics = getattr(ext_module, f"{ext.code}_static_files")
|
if hasattr(ext_module, f"{ext.code}_static_files"):
|
||||||
for s in ext_statics:
|
ext_statics = getattr(ext_module, f"{ext.code}_static_files")
|
||||||
app.mount(s["path"], s["app"], s["name"])
|
for s in ext_statics:
|
||||||
|
app.mount(s["path"], s["app"], s["name"])
|
||||||
|
|
||||||
app.include_router(ext_route)
|
app.include_router(ext_route)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue