Skip to content

Commit 6fabd6b

Browse files
committed
fix dns record check
1 parent 08686a7 commit 6fabd6b

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/aleph/sdk/domain.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,14 @@ async def check_domain(self, url: str, target: str, owner: Optional[str] = None)
7777

7878
if record_type == "txt":
7979
found = False
80-
81-
for _res in res:
82-
if hasattr(_res, "text") and _res.text == record_value:
83-
found = True
84-
85-
if found == False:
86-
raise DomainConfigurationError(
87-
(dns_rule["info"], dns_rule["on_error"], status)
88-
)
89-
80+
if res is not None:
81+
for _res in res:
82+
if hasattr(_res, "text") and _res.text == record_value:
83+
found = True
84+
if found == False:
85+
raise DomainConfigurationError(
86+
(dns_rule["info"], dns_rule["on_error"], status)
87+
)
9088
elif (
9189
res is None
9290
or not hasattr(res, record_type)

0 commit comments

Comments
 (0)