diff --git a/addons/im_livechat/models/im_livechat_channel.py b/addons/im_livechat/models/im_livechat_channel.py index 8ccd3f99063..c9217504cdd 100644 --- a/addons/im_livechat/models/im_livechat_channel.py +++ b/addons/im_livechat/models/im_livechat_channel.py @@ -270,7 +270,9 @@ class ImLivechatChannelRule(models.Model): """ def _match(rules): for rule in rules: - if re.search(rule.regex_url or '', url): + # url might not be set because it comes from referer, in that + # case match the first rule with no regex_url + if re.search(rule.regex_url or '', url or ''): return rule return False # first, search the country specific rules (the first match is returned)