Skip to content

Commit

Permalink
Merge pull request #447 from vinceis1337/dev
Browse files Browse the repository at this point in the history
Add null check on attributionIdentifiers to prevent null pointer exceptions
  • Loading branch information
gcaglar committed Oct 15, 2015
2 parents 8bbc56c + 0768cbd commit 07e4a98
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion facebook/src/com/facebook/GraphRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,9 @@ public static GraphRequest newCustomAudienceThirdPartyIdRequest(AccessToken acce
Bundle parameters = new Bundle();

if (accessToken == null) {
if (attributionIdentifiers == null) {
throw new FacebookException("There is no access token and attribution identifiers could not be retrieved");
}
// Only use the attributionID if we don't have an access token. If we do, then the user
// token will be used to identify the user, and is more reliable than the attributionID.
String udid = attributionIdentifiers.getAttributionId() != null
Expand All @@ -617,7 +620,7 @@ public static GraphRequest newCustomAudienceThirdPartyIdRequest(AccessToken acce
// Server will choose to not provide the App User ID in the event that event usage has been
// limited for this user for this app.
if (FacebookSdk.getLimitEventAndDataUsage(context)
|| attributionIdentifiers.isTrackingLimited()) {
|| (attributionIdentifiers != null && attributionIdentifiers.isTrackingLimited())) {
parameters.putString("limit_event_usage", "1");
}

Expand Down

0 comments on commit 07e4a98

Please sign in to comment.