From 71cbd27b7ed6238f6d16697483ecbd5970a98e4d Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Tue, 18 Feb 2025 16:51:35 +0100 Subject: [PATCH] Check if video exists before assignment (#1788) --- skyvern/webeye/browser_factory.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/skyvern/webeye/browser_factory.py b/skyvern/webeye/browser_factory.py index 674351dd..6bad8c57 100644 --- a/skyvern/webeye/browser_factory.py +++ b/skyvern/webeye/browser_factory.py @@ -482,7 +482,8 @@ class BrowserState: if self.browser_artifacts.video_artifacts[index].video_path is None: try: async with asyncio.timeout(settings.BROWSER_ACTION_TIMEOUT_MS / 1000): - self.browser_artifacts.video_artifacts[index].video_path = await page.video.path() + if page.video: + self.browser_artifacts.video_artifacts[index].video_path = await page.video.path() except asyncio.TimeoutError: LOG.info("Timeout to get the page video, skip the exception") except Exception: @@ -495,7 +496,8 @@ class BrowserState: ) try: async with asyncio.timeout(settings.BROWSER_ACTION_TIMEOUT_MS / 1000): - self.browser_artifacts.video_artifacts[index].video_path = await page.video.path() + if page.video: + self.browser_artifacts.video_artifacts[index].video_path = await page.video.path() except asyncio.TimeoutError: LOG.info("Timeout to get the page video, skip the exception") except Exception: