Skip to content

Commit 63247a1

Browse files
authored
fix: catch all index errors in the history iterator (#1163)
1 parent f1275ad commit 63247a1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

interactions/api/models/channel.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,10 @@ async def get_objects(self) -> None:
210210
self.objects.extend([Message(**msg, _client=self._client) for msg in msgs])
211211

212212
async def __anext__(self) -> "Message":
213-
if self.objects is None:
214-
await self.get_first_objects()
215-
216213
try:
214+
if self.objects is None:
215+
await self.get_first_objects()
216+
217217
obj = self.objects.pop(0)
218218

219219
if self.check:

0 commit comments

Comments
 (0)