diff --git a/account_banking_pain_base/models/res_bank.py b/account_banking_pain_base/models/res_bank.py index 3713735c8..efdc95903 100644 --- a/account_banking_pain_base/models/res_bank.py +++ b/account_banking_pain_base/models/res_bank.py @@ -22,7 +22,7 @@ class ResBank(models.Model): :raise: ValidationError if the BIC doesn't respect the regex of the SEPA pain schemas. """ - invalid_banks = self.filtered(lambda r: not BIC_REGEX.match(r.bic)) + invalid_banks = self.filtered(lambda r: r.bic and not BIC_REGEX.match(r.bic)) if invalid_banks: raise ValidationError(_( "The following Bank Identifier Codes (BIC) do not respect "