Skip to content

Commit

Permalink
Added null check
Browse files Browse the repository at this point in the history
  • Loading branch information
Devota Aabel committed Mar 20, 2019
1 parent 04f8920 commit 29e4f74
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -43,7 +43,9 @@ class NavigationPerformanceEvent extends Event implements Parcelable {
this.attributes = new ArrayList<>();
this.metadata = metadata;
attributes.add(new Attribute(EVENT_NAME, eventName));
attributes.add(new Attribute(SCREEN_DENSITY, getScreenDensity(context)));
if (context != null) {
attributes.add(new Attribute(SCREEN_DENSITY, getScreenDensity(context)));
}
}

private String getScreenDensity(Context context) {
Expand Down

0 comments on commit 29e4f74

Please sign in to comment.