pyrofork: fix NoneType exception in filters
Some checks failed
Build-docs / build (push) Has been cancelled
Pyrofork / build (macos-latest, 3.10) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.11) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.12) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.13) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.9) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.10) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.11) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.12) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.13) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.9) (push) Has been cancelled

Signed-off-by: wulan17 <wulan17@komodos.id>
This commit is contained in:
wulan17 2025-06-25 19:10:50 +07:00
parent 99801df191
commit 407e75316b
No known key found for this signature in database
GPG key ID: 737814D4B5FF0420

View file

@ -1035,7 +1035,7 @@ class user(Filter, set):
async def __call__(self, _, message: Message):
is_usernames_in_filters = False
if message.from_user.usernames:
if message.from_user and message.from_user.usernames:
for username in message.from_user.usernames:
if (
username.username in self
@ -1078,7 +1078,7 @@ class chat(Filter, set):
async def __call__(self, _, message: Union[Message, Story]):
if isinstance(message, Story):
is_usernames_in_filters = False
if message.sender_chat.usernames:
if message.sender_chat and message.sender_chat.usernames:
for username in message.sender_chat.usernames:
if (
username.username in self
@ -1107,7 +1107,7 @@ class chat(Filter, set):
) or is_usernames_in_filters
else:
is_usernames_in_filters = False
if message.chat.usernames:
if message.chat and message.chat.usernames:
for username in message.chat.usernames:
if (
username.username in self