diff options
author | Sebastien Vincent <seb@jitsi.org> | 2011-05-25 15:06:27 +0000 |
---|---|---|
committer | Sebastien Vincent <seb@jitsi.org> | 2011-05-25 15:06:27 +0000 |
commit | 0abf389e39a9087bff3e3af5f6dd5d948b55d7c3 (patch) | |
tree | 3ec7a15a09951cb09b0ce7c0de680043f6be738e /src/net/java | |
parent | 980fd931e7f081c4f4d4462233db5be5681280ff (diff) | |
download | jitsi-0abf389e39a9087bff3e3af5f6dd5d948b55d7c3.zip jitsi-0abf389e39a9087bff3e3af5f6dd5d948b55d7c3.tar.gz jitsi-0abf389e39a9087bff3e3af5f6dd5d948b55d7c3.tar.bz2 |
Fix a possible NullPointerException in Google Contacts.
Diffstat (limited to 'src/net/java')
-rw-r--r-- | src/net/java/sip/communicator/impl/googlecontacts/GoogleContactsEntryImpl.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/net/java/sip/communicator/impl/googlecontacts/GoogleContactsEntryImpl.java b/src/net/java/sip/communicator/impl/googlecontacts/GoogleContactsEntryImpl.java index e594639..37dc8fb 100644 --- a/src/net/java/sip/communicator/impl/googlecontacts/GoogleContactsEntryImpl.java +++ b/src/net/java/sip/communicator/impl/googlecontacts/GoogleContactsEntryImpl.java @@ -358,7 +358,6 @@ public class GoogleContactsEntryImpl { givenName = name.getGivenName().getValue(); } - } photoLink = contact.getContactPhotoLink().getHref(); @@ -366,7 +365,11 @@ public class GoogleContactsEntryImpl 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 @@ public class GoogleContactsEntryImpl { homePhones.add(phone.getPhoneNumber()); } - if(phone.getRel().contains("#work")) + else if(phone.getRel().contains("#work")) { workPhones.add(phone.getPhoneNumber()); } @@ -409,7 +412,11 @@ public class GoogleContactsEntryImpl 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; } |