Skip to content

Commit 3b8038c

Browse files
committed
fix dns record check
1 parent 08686a7 commit 3b8038c

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/aleph/sdk/domain.py

Lines changed: 4 additions & 6 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-
80+
if res is not None:
81+
for _res in res:
82+
if hasattr(_res, "text") and _res.text == record_value:
83+
found = True
8584
if found == False:
8685
raise DomainConfigurationError(
8786
(dns_rule["info"], dns_rule["on_error"], status)
8887
)
89-
9088
elif (
9189
res is None
9290
or not hasattr(res, record_type)

0 commit comments

Comments
 (0)