Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/main/java/com/launchdarkly/client/LDUser.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,14 @@ public LDUser(String key) {
}

protected JsonElement getValueForEvaluation(String attribute) {
JsonElement returnVal = getCustom(attribute);
if (returnVal != null) {
return returnVal;
}
try {
return UserAttribute.valueOf(attribute).get(this);
} catch (IllegalArgumentException expected) {
return getCustom(attribute);
return null;
}
}

Expand Down Expand Up @@ -127,7 +131,7 @@ JsonPrimitive getAnonymous() {
}

JsonElement getCustom(String key) {
if (custom != null) {
if (custom != null && !custom.isEmpty()) {
return custom.get(key);
}
return null;
Expand Down