From 94bae7c5e33aa55c8ba0bcd29b483859a09770be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Thu, 4 Aug 2022 21:11:58 +0200 Subject: [PATCH] chg: Avoid exception on broken captures --- bin/async_capture.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/async_capture.py b/bin/async_capture.py index 4457ca6..aa9c327 100755 --- a/bin/async_capture.py +++ b/bin/async_capture.py @@ -89,9 +89,11 @@ class AsyncCapture(AbstractManager): with open(tmp_f.name, "wb") as f: f.write(to_capture[b'document']) url = f'file://{tmp_f.name}' - else: + elif to_capture.get(b'url'): url = to_capture[b'url'].decode() self.thirdparty_submit(url) + else: + self.logger.warning(f'Invalid capture {to_capture}.') self.logger.info(f'Capturing {url} - {uuid}') success, error_message = await self._capture(