Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

record output fails if empty contacts #893

Closed
pvgenuchten opened this issue Sep 7, 2023 · 0 comments
Closed

record output fails if empty contacts #893

pvgenuchten opened this issue Sep 7, 2023 · 0 comments

Comments

@pvgenuchten
Copy link
Contributor

Description

a problem when contacts is empty

  File "/home/pycsw/pycsw/pycsw/ogc/api/records.py", line 828, in item
    response = record2json(record, self.config['server']['url'], collection, stac_item)
  File "/home/pycsw/pycsw/pycsw/ogc/api/records.py", line 1065, in record2json
    for cnt in json.loads(record.contacts):
  File "/usr/lib/python3.8/json/__init__.py", line 341, in loads
    raise TypeError(f'the JSON object must be str, bytes or bytearray, '
TypeError: the JSON object must be str, bytes or bytearray, not NoneType

add check to see if contacts in '' or none

Environment

  • operating system: linux
  • Python version: 3.7
  • pycsw version: master
pvgenuchten pushed a commit to pvgenuchten/pycsw that referenced this issue Sep 7, 2023
kalxas pushed a commit that referenced this issue Sep 13, 2023
Co-authored-by: Genuchten <paul.vangenuchten@wur.nl>
@kalxas kalxas closed this as completed Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants