Fixed an NPE when the users name is null

This commit is contained in:
Lee Newson 2014-05-31 10:39:34 +10:00
parent 4d8c3d7d73
commit 3bcf2c81da

View file

@ -34,12 +34,14 @@ public class SocialUser {
}
public void setName(String name) {
int i = name.lastIndexOf(' ');
if (i != -1) {
firstName = name.substring(0, i);
lastName = name.substring(i + 1);
} else {
firstName = name;
if (name != null) {
int i = name.lastIndexOf(' ');
if (i != -1) {
firstName = name.substring(0, i);
lastName = name.substring(i + 1);
} else {
firstName = name;
}
}
}