pyrofork: Fix IndexError error in Client.get_stories

Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
wulan17 2024-06-15 14:27:08 +07:00
parent 7a9ffa2506
commit d863655769
No known key found for this signature in database
GPG key ID: 318CD6CD3A6AC0A5

View file

@ -74,4 +74,4 @@ class GetStories:
if is_iterable:
return types.List([await types.Story._parse(self, story, peer) for story in r.stories])
return await types.Story._parse(self, r.stories[0], peer)
return await types.Story._parse(self, r.stories[0], peer) if r.stories and len(r.stories) > 0 else None