urldetect: Don't run regex against None SUSE product name

We are implicitly depending on random dict ordering for what
order we process Distro matching. Our test suite mocking and
different debian ordering revealed a case we could be trying to
run a regex against None. Fix it. The dict ordering issue will
be fixed separately
This commit is contained in:
Cole Robinson 2019-06-10 08:42:39 -04:00
parent b4c9e4b114
commit 578451fe72

View File

@ -493,7 +493,7 @@ class _SuseDistro(_RHELDistro):
if not cache.suse_content: if not cache.suse_content:
return False return False
for regex in cls._suse_regex: for regex in cls._suse_regex:
if re.match(regex, cache.suse_content.product_name): if re.match(regex, cache.suse_content.product_name or ""):
return True return True
return False return False