question

nathan-1 avatar image
nathan-1 asked

FriendList Statistics Null Reference Exception

I am trying to get statistics from the GetFriendsList API call, but the Profile of each friend is null so I cannot access the statistics. I've checked under each friend and they all have statistics. Why is this the case?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

For a Client API call that gets profile data, you need to define which profile elements the client is allowed to query via the Settings->Client Profile Options page.

10 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

nathan-1 avatar image nathan-1 commented ·

I just added Statistics as an allowed profile element but I still am not able to access it. How long does it take for the modification to take effect?

0 Likes 0 ·
brendan avatar image brendan nathan-1 commented ·

What Title ID and PlayFab IDs are you using for the test, so that we can have a look?

0 Likes 0 ·
nathan-1 avatar image nathan-1 brendan commented ·

Is there a way to privately contact you (email)? I don't want to post the Title ID publicly.

0 Likes 0 ·
Show more comments
nathan-1 avatar image nathan-1 commented ·

Ah I see, thank you

Title ID: BD66
PlayFab IDs: 2D59B8F44EDD74F, EFBD4E2FE7BBE782, 4F541FB2F83DB01B

0 Likes 0 ·
brendan avatar image brendan nathan-1 commented ·

What are the specific parameters you're passing into the query, and what profile are you logged into at the time? One thing to note is that the last of those accounts has no one in its friends list: https://developer.playfab.com/en-US/BD66/players/4F541FB2F83DB01B/friends.

0 Likes 0 ·
nathan-1 avatar image nathan-1 brendan commented ·

Logged into: EFBD4E2FE7BBE782 and trying to statistics from friendlist.

I'm trying to get entry.Profile, where entry is a PlayFab.ClientModels.FriendInfo
entry.Profile returns null and entry.Profile.Statistics returns a NullException

0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.