[FIX] im_livechat: empty regex

If `regex_url` is not set, `re.search` crashes.

opw-1805669
This commit is contained in:
Nicolas Martinelli
2018-03-06 15:02:22 +01:00
committed by Nicolas Martinelli
parent d59fe9c58c
commit 8cfb485891
@@ -239,7 +239,7 @@ class ImLivechatChannelRule(models.Model):
"""
def _match(rules):
for rule in rules:
if re.search(rule.regex_url, url):
if re.search(rule.regex_url or '', url):
return rule
return False
# first, search the country specific rules (the first match is returned)