fix: fix error on empty or none string src in rule CheckScmInSrc (#608)

This commit is contained in:
Robert Kaussow 2023-05-29 13:47:46 +02:00 committed by GitHub
parent a77609197f
commit adc1801724
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,7 +16,8 @@ class CheckScmInSrc(StandardBase):
if not errors: if not errors:
for role in roles: for role in roles:
if isinstance(role, AnsibleMapping) and "+" in role.get("src"): src = role.get("src")
if isinstance(role, AnsibleMapping) and bool(src) and "+" in src:
errors.append(self.Error(role["__line__"], self.helptext)) errors.append(self.Error(role["__line__"], self.helptext))
return self.Result(candidate.path, errors) return self.Result(candidate.path, errors)