Skip to content

Commit c629563

Browse files
committed
fix(user attributes): LP-3626 - fix for setting a user attribute to null does not clear it in the User Profile.
1 parent 038619b commit c629563

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

AndroidSDK/src/com/leanplum/internal/LeanplumInternal.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -532,10 +532,6 @@ public static <T> Map<String, T> validateAttributes(Map<String, T> attributes, S
532532
for (Map.Entry<String, T> entry : attributes.entrySet()) {
533533
T value = entry.getValue();
534534

535-
if (value == null) {
536-
continue;
537-
}
538-
539535
// Validate lists.
540536
if (allowLists && value instanceof Iterable<?>) {
541537
boolean valid = true;
@@ -556,7 +552,7 @@ public static <T> Map<String, T> validateAttributes(Map<String, T> attributes, S
556552
Date date = CollectionUtil.uncheckedCast(value);
557553
value = CollectionUtil.uncheckedCast(date.getTime());
558554
}
559-
if (!isValidScalarValue(value, argName)) {
555+
if (value != null && !isValidScalarValue(value, argName)) {
560556
continue;
561557
}
562558
}

0 commit comments

Comments
 (0)