Lightmatter / welkin-health

A Python wrapper of the Welkin Health API
https://welkin.readthedocs.io
Other
4 stars 3 forks source link

Bug in `Resource.__getattr__` #105

Open samamorgan opened 6 months ago

samamorgan commented 6 months ago

If an key exists in a Resource, but that key is defined in Resource.nested_objects, and the value of that key is None, the following exception is raised:

TypeError: 'NoneType' object is not iterable

For example:

program = PatientProgram(currentPhase=None)
program.currentPhase

Traceback (most recent call last):
  TypeError: 'NoneType' object is not iterable

The workaround for now, is to just access the attribute using dict syntax: program["currentPhase"]