Skip to content

Commit 5b94c34

Browse files
committed
Fix Filters.regex failing in case the value is None
1 parent 22eb42e commit 5b94c34

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

pyrogram/client/filters/filters.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,8 @@ def func(flt, update):
323323
else:
324324
raise ValueError("Regex filter doesn't work with {}".format(type(update)))
325325

326-
update.matches = list(flt.p.finditer(value)) or None
326+
if value:
327+
update.matches = list(flt.p.finditer(value)) or None
327328

328329
return bool(update.matches)
329330

0 commit comments

Comments
 (0)