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

Bug in Resource.__getattr__ #105

Open
samamorgan opened this issue Apr 25, 2024 · 0 comments
Open

Bug in Resource.__getattr__ #105

samamorgan opened this issue Apr 25, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@samamorgan
Copy link
Collaborator

samamorgan commented Apr 25, 2024

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"]

@samamorgan samamorgan added the bug Something isn't working label Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant