Currently we're looking up characters by just grabbing whatever's at the 0th index of the destinyMemberships array, since anyone who's set up cross-save will have the same set of characters returned regardless of which platform is represented by the first membership in the array.
Ignoring that some kind of edge case should probably exist for non-cross-save users, it also looks like it wasn't a safe bet that every user's destinyMemberships array has at least one item in it. Reference user a#123 as an example of the destinyMemberships property just being an empty array.
Need to set up some kind of error handling for this edge case. Perhaps it's best to just exclude this kind of user from showing as a search result.
Currently we're looking up characters by just grabbing whatever's at the 0th index of the destinyMemberships array, since anyone who's set up cross-save will have the same set of characters returned regardless of which platform is represented by the first membership in the array.
Ignoring that some kind of edge case should probably exist for non-cross-save users, it also looks like it wasn't a safe bet that every user's destinyMemberships array has at least one item in it. Reference user a#123 as an example of the destinyMemberships property just being an empty array.
Need to set up some kind of error handling for this edge case. Perhaps it's best to just exclude this kind of user from showing as a search result.