diff --git a/src/aleph/sdk/domain.py b/src/aleph/sdk/domain.py index 56bdb093..ce5e55f3 100644 --- a/src/aleph/sdk/domain.py +++ b/src/aleph/sdk/domain.py @@ -77,16 +77,14 @@ async def check_domain(self, url: str, target: str, owner: Optional[str] = None) if record_type == "txt": found = False - - for _res in res: - if hasattr(_res, "text") and _res.text == record_value: - found = True - + if res is not None: + for _res in res: + if hasattr(_res, "text") and _res.text == record_value: + found = True if found == False: raise DomainConfigurationError( (dns_rule["info"], dns_rule["on_error"], status) ) - elif ( res is None or not hasattr(res, record_type)