Prevent account's full name from being set to empty string

If the full name is an empty string, set it to null instead.

Change-Id: Ic1a0685c764e47349d713e21f4f0ff6da784d49b
This commit is contained in:
David Pursehouse 2013-04-26 10:58:56 +09:00
parent e61aa030c2
commit 1decc490fb

View File

@ -169,7 +169,11 @@ public final class Account {
/** Set the full name of the user ("Given-name Surname" style). */
public void setFullName(final String name) {
fullName = name != null ? name.trim() : null;
if (name != null && !name.trim().isEmpty()) {
fullName = name.trim();
} else {
fullName = null;
}
}
/** Email address the user prefers to be contacted through. */