Fix a possible NullPointerException in Google Contacts.

cusax-fix
Sebastien Vincent 15 years ago
parent 980fd931e7
commit 0abf389e39

@ -358,7 +358,6 @@ public void setField(ContactEntry contact)
{
givenName = name.getGivenName().getValue();
}
}
photoLink = contact.getContactPhotoLink().getHref();
@ -366,7 +365,11 @@ public void setField(ContactEntry contact)
for(Email mail : contact.getEmailAddresses())
{
if(mail.getRel().contains("#home"))
if(mail.getRel() == null)
{
homeMails.add(mail.getAddress());
}
else if(mail.getRel().contains("#home"))
{
homeMails.add(mail.getAddress());
}
@ -386,7 +389,7 @@ else if(mail.getRel().contains("#work"))
{
homePhones.add(phone.getPhoneNumber());
}
if(phone.getRel().contains("#work"))
else if(phone.getRel().contains("#work"))
{
workPhones.add(phone.getPhoneNumber());
}
@ -409,7 +412,11 @@ else if(phone.getRel().contains("#home"))
String protocol = imAddress.getProtocol();
IMProtocol proto;
if(protocol.equals(GOOGLETALK_PROTOCOL))
if(protocol == null)
{
proto = GoogleContactsEntry.IMProtocol.OTHER;
}
else if(protocol.equals(GOOGLETALK_PROTOCOL))
{
proto = GoogleContactsEntry.IMProtocol.GOOGLETALK;
}

Loading…
Cancel
Save