Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.

Commit 571c92b

Browse files
committed
Merge pull request #17 from launchdarkly/jko/anonymous-obj
Use Boolean for anonymous
2 parents 7c05b62 + e85eb37 commit 571c92b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/main/java/com/launchdarkly/client/LDUser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class LDUser {
3232
private String avatar;
3333
private String firstName;
3434
private String lastName;
35-
private boolean anonymous;
35+
private Boolean anonymous;
3636

3737
private LDCountryCode country;
3838
private Map<String, JsonElement> custom;
@@ -86,7 +86,7 @@ String getKey() {
8686

8787
String getAvatar() { return avatar; }
8888

89-
boolean getAnonymous() { return anonymous; }
89+
Boolean getAnonymous() { return anonymous; }
9090

9191
JsonElement getCustom(String key) {
9292
return custom.get(key);

src/main/java/com/launchdarkly/client/Variation.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,9 @@ else if (attribute.equals("name")) {
138138
}
139139
}
140140
else if (attribute.equals("anonymous")) {
141-
uValue = user.getAnonymous();
141+
if (user.getAnonymous() != null) {
142+
uValue = user.getAnonymous();
143+
}
142144
}
143145
else { // Custom attribute
144146
JsonElement custom = user.getCustom(attribute);

0 commit comments

Comments
 (0)