mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 04:58:45 +00:00
Consider empty usernames as absent.
This commit is contained in:
@@ -666,7 +666,7 @@ public class Recipient {
|
||||
|
||||
public @NonNull Optional<String> getUsername() {
|
||||
if (FeatureFlags.usernames()) {
|
||||
return Optional.ofNullable(username);
|
||||
return OptionalUtil.absentIfEmpty(username);
|
||||
} else {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ object OptionalUtil {
|
||||
|
||||
@JvmStatic
|
||||
fun absentIfEmpty(value: String?): Optional<String> {
|
||||
return if (value == null || value.isEmpty()) {
|
||||
return if (value.isNullOrEmpty()) {
|
||||
Optional.empty()
|
||||
} else {
|
||||
Optional.of(value)
|
||||
|
||||
Reference in New Issue
Block a user