For some reason some non-page objects make it through the code and they don't have the content
key so the connector crashes in that cases.
{'space': {'key': 'CFS', 'name': 'TEST', 'type': 'global', 'metadata': {}, 'status': 'current', '_expandable': {'operations': '', 'permissions': '', 'description': ''}, '_links': {'self': 'https://xxxx-xxx.atlassian.net/wiki/rest/api/space/CFS'}}, 'title': '@@@hl@@@TEST@@@endhl@@@ Financial Solutions', 'excerpt': '', 'url': '/spaces/CFS', 'resultGlobalContainer': {'title': 'TEST Financial Solutions', 'displayUrl': '/spaces/CFS'}, 'breadcrumbs': [], 'entityType': 'space', 'iconCssClass': 'aui-icon content-type-space', 'lastModified': '2024-02-05T14:04:51.000Z', 'friendlyLastModified': 'about 2 hours ago', 'score': 0.0}
async def _gather(self, pages, results):
tasks = []
for page in pages:
# Added check for content to avoid errors
if "content" not in page:
continue
# end of added check
page_id = page["content"]["id"]
tasks.append(self._fetch_page(page_id, results))
return await asyncio.gather(*tasks)