Skip to content

Commit 28c8762

Browse files
authored
Update domain.py (#144)
Catch the AttributeError exception and return False.
1 parent 84dfb21 commit 28c8762

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

validators/domain.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,5 @@ def domain(value):
5858
"""
5959
try:
6060
return pattern.match(to_unicode(value).encode('idna').decode('ascii'))
61-
except UnicodeError:
61+
except (UnicodeError, AttributeError):
6262
return False

0 commit comments

Comments
 (0)