Closed
Description
Describe the bug
It seems like the data returned by the API is inconsistent and sometimes data is missing.
We need to make the profile page bulletproof by:
- Ensuring an array exists before calling
.length
- Ensuring an array exists before calling
.map()
You can use lodash
's _.get
for this.
Eg: object.myArray.map()
should be _.get(object, 'myArray', []).map()
... or you can suggest a better approach if you want.
To Reproduce
Steps to reproduce the behavior:
- Go to 'https://community-app.topcoder-dev.com/members/tourist
- See error
Expected behavior
The page should load without issues.