Merge pull request #176 from fukusuket/fix-500-error-when-crawler-screenshot-setting-off

fix: [crawler] added existence check for screenshot set
This commit is contained in:
Thirion Aurélien 2023-07-10 09:59:35 +02:00 committed by GitHub
commit 29b8cee418
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -392,7 +392,7 @@ class Domain(AbstractObject):
_write_in_zip_buffer(zf, os.path.join(hars_dir, har), f'{basename}.json') _write_in_zip_buffer(zf, os.path.join(hars_dir, har), f'{basename}.json')
# Screenshot # Screenshot
screenshot = self._get_external_correlation('item', '', item_id, 'screenshot') screenshot = self._get_external_correlation('item', '', item_id, 'screenshot')
if screenshot: if screenshot and screenshot['screenshot']:
screenshot = screenshot['screenshot'].pop()[1:] screenshot = screenshot['screenshot'].pop()[1:]
screenshot = os.path.join(screenshot[0:2], screenshot[2:4], screenshot[4:6], screenshot[6:8], screenshot = os.path.join(screenshot[0:2], screenshot[2:4], screenshot[4:6], screenshot[6:8],
screenshot[8:10], screenshot[10:12], screenshot[12:]) screenshot[8:10], screenshot[10:12], screenshot[12:])