From 5ddf32dd09a487defe1bc329acec0b71d6451bc6 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Thu, 16 Jun 2022 18:56:42 -0400 Subject: [PATCH] Fix potential infinite loop in Reaction.users --- discord/reaction.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/discord/reaction.py b/discord/reaction.py index 3653dff73..302358880 100644 --- a/discord/reaction.py +++ b/discord/reaction.py @@ -237,6 +237,9 @@ class Reaction: if data: limit -= len(data) after = Object(id=int(data[-1]['id'])) + else: + # Terminate loop if we received no data + limit = 0 if guild is None or isinstance(guild, Object): for raw_user in reversed(data):