AttributeError: 'NoneType' object has no attribute 'bank'

I get this Error when making payment from Purchase Invoice doctype

Traceback (most recent call last):
File “/home/administrator/frappe-bench/apps/frappe/frappe/app.py”, line 61, in application
response = frappe.handler.handle()
File “/home/administrator/frappe-bench/apps/frappe/frappe/handler.py”, line 21, in handle
data = execute_cmd(cmd)
File “/home/administrator/frappe-bench/apps/frappe/frappe/handler.py”, line 56, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/administrator/frappe-bench/apps/frappe/frappe/init.py”, line 1020, in call
return fn(*args, **newargs)
File “/home/administrator/frappe-bench/apps/erpnext/erpnext/accounts/doctype/payment_entry/payment_entry.py”, line 911, in get_payment_entry
pe.set_bank_account_data()
File “/home/administrator/frappe-bench/apps/erpnext/erpnext/accounts/doctype/payment_entry/payment_entry.py”, line 98, in set_bank_account_data
self.bank = bank_data.bank
AttributeError: ‘NoneType’ object has no attribute ‘bank’

Solved! there was no bank account declared in my Company

Hi, the same error is happening again , although the default bank account in the company is properly set. it is showing this error with
ERPNext: v12.14.0 (version-12)
Frappe Framework: v12.12.0 (version-12)
Any advice or is it a bug in this version … it works good on the earlier version!!
ERPNext: v12.12.1 (version-12)
Frappe Framework: v12.10.2 (version-12)
I cannot create payment from the button “create” in the sales invoice- the error displays