From 4f96ee402bc39ad6dbc6e5aeb2bf1539177b4724 Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Mon, 1 Aug 2022 23:40:08 +0100 Subject: [PATCH] serve: Add check that all devices in config exist --- pywidevine/serve.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pywidevine/serve.py b/pywidevine/serve.py index 53f324e..bf2bf65 100644 --- a/pywidevine/serve.py +++ b/pywidevine/serve.py @@ -29,6 +29,9 @@ async def _startup(app: web.Application): for x in app["config"]["devices"] for path in [Path(x)] } + for device in app["config"]["devices"].values(): + if not device.is_file(): + raise FileNotFoundError(f"Device file does not exist: {device}") async def _cleanup(app: web.Application):