Check if video exists before assignment (#1788)
This commit is contained in:
@@ -482,6 +482,7 @@ class BrowserState:
|
||||
if self.browser_artifacts.video_artifacts[index].video_path is None:
|
||||
try:
|
||||
async with asyncio.timeout(settings.BROWSER_ACTION_TIMEOUT_MS / 1000):
|
||||
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")
|
||||
@@ -495,6 +496,7 @@ class BrowserState:
|
||||
)
|
||||
try:
|
||||
async with asyncio.timeout(settings.BROWSER_ACTION_TIMEOUT_MS / 1000):
|
||||
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")
|
||||
|
||||
Reference in New Issue
Block a user