diff --git a/validators/validators.py b/validators/validators.py index aadab3e..9ff8f47 100644 --- a/validators/validators.py +++ b/validators/validators.py @@ -11,6 +11,8 @@ def empty(field: str) -> bool: def iso_date(field: str) -> bool: + if not field: + return False try: datetime.datetime.strptime(field, "%Y-%m-%d") return True @@ -19,6 +21,10 @@ def iso_date(field: str) -> bool: def valid_iban(field: str) -> bool: + if not field: + return False + if not type(field) == str: + return False try: IBAN(field) return True @@ -27,6 +33,10 @@ def valid_iban(field: str) -> bool: def valid_bic(field: str) -> bool: + if not field: + return False + if not type(field) == str: + return False try: BIC(field) return True