Skip to content
This repository has been archived by the owner on Apr 5, 2022. It is now read-only.

NullPointerException invocating SocialContextOperations#getAllMutualFriends(java.lang.String) #219

Open
troig opened this issue Oct 10, 2016 · 0 comments

Comments

@troig
Copy link

troig commented Oct 10, 2016

There is a NullPointerException invocating the method getAllMutualFriends of org.springframework.social.facebook.api.SocialContextOperations.

According to the facebook graph API documentation, the attribute ID can be optional.

The ID will be returned for a mutual friend only if the given user has installed your app and granted the user_friends permission.

So, the NPE occurs iterating the response, when the attribute is accessed to retrieve the value.
Method org.springframework.social.facebook.api.impl.SocialContextTemplate#getSocialContext, line 135: itemNode.get("id") is null and we get NPE:

for (JsonNode itemNode : dataNode) {
    results.add(new Reference(itemNode.get("id").textValue(), itemNode.get("name").textValue()));
}
``
`
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant