diff --git a/invenio_accounts/datastore.py b/invenio_accounts/datastore.py index 98808247..5f0c2fb7 100644 --- a/invenio_accounts/datastore.py +++ b/invenio_accounts/datastore.py @@ -113,6 +113,9 @@ def find_role_by_id(self, role_id): def find_domain(self, domain_or_id): """Find a domain by value or ID.""" + if domain_or_id is None: + return None + if isinstance(domain_or_id, str): if domain_or_id.isdigit(): clause = Domain.id == int(domain_or_id)