diff --git a/bookwyrm/views/inbox.py b/bookwyrm/views/inbox.py index d1b75997..a8eb4851 100644 --- a/bookwyrm/views/inbox.py +++ b/bookwyrm/views/inbox.py @@ -70,7 +70,10 @@ def is_blocked_user_agent(request): user_agent = request.headers.get("User-Agent") if not user_agent: return False - url = re.search(r"https?://{:s}/?".format(regex.domain), user_agent).group() + url = re.search(r"https?://{:s}/?".format(regex.domain), user_agent) + if not url: + return False + url = url.group() return models.FederatedServer.is_blocked(url)