Skip to content

Member profile fails to load for some users #2277

Closed
@ThomasKranitsas

Description

@ThomasKranitsas

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:

  1. Go to 'https://community-app.topcoder-dev.com/members/tourist
  2. See error

Expected behavior
The page should load without issues.

Screenshots
Screenshot 2019-03-29 at 11 51 27

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions