From 5b94c340c072382b686c1f90fdcc6bac4ce9d503 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sat, 16 May 2020 14:40:22 +0200 Subject: [PATCH] Fix Filters.regex failing in case the value is None --- pyrogram/client/filters/filters.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyrogram/client/filters/filters.py b/pyrogram/client/filters/filters.py index d740d3c7..19218813 100644 --- a/pyrogram/client/filters/filters.py +++ b/pyrogram/client/filters/filters.py @@ -323,7 +323,8 @@ class Filters: else: raise ValueError("Regex filter doesn't work with {}".format(type(update))) - update.matches = list(flt.p.finditer(value)) or None + if value: + update.matches = list(flt.p.finditer(value)) or None return bool(update.matches)