diff options
author | Yana Stamcheva <yana@jitsi.org> | 2013-04-19 23:03:54 +0000 |
---|---|---|
committer | Yana Stamcheva <yana@jitsi.org> | 2013-04-19 23:03:54 +0000 |
commit | cb1708e1a01a269c6cdbe52649abc653c34a95be (patch) | |
tree | 79cf3be54c3fdaccef02fe368eb76d7842c8e015 | |
parent | 60c4cf713a4494565a89c861d4592c3584322476 (diff) | |
download | jitsi-cb1708e1a01a269c6cdbe52649abc653c34a95be.zip jitsi-cb1708e1a01a269c6cdbe52649abc653c34a95be.tar.gz jitsi-cb1708e1a01a269c6cdbe52649abc653c34a95be.tar.bz2 |
Fixes a NumberFormatException in icq contact info retriever.
-rw-r--r-- | src/net/java/sip/communicator/impl/protocol/icq/InfoRetreiver.java | 36 | ||||
-rw-r--r-- | src/net/java/sip/communicator/impl/protocol/icq/OperationSetServerStoredContactInfoIcqImpl.java | 4 |
2 files changed, 24 insertions, 16 deletions
diff --git a/src/net/java/sip/communicator/impl/protocol/icq/InfoRetreiver.java b/src/net/java/sip/communicator/impl/protocol/icq/InfoRetreiver.java index 6c1cd4f..6bb175c 100644 --- a/src/net/java/sip/communicator/impl/protocol/icq/InfoRetreiver.java +++ b/src/net/java/sip/communicator/impl/protocol/icq/InfoRetreiver.java @@ -135,25 +135,33 @@ public class InfoRetreiver */ protected List<GenericDetail> retrieveDetails(String uin) { - int reqID = requestID++; + List<GenericDetail> result = null; + // Fixes a NumberFormatException, occurring if the uin is not a long + // number. + try + { + //retrieve the details + long toICQUin = Long.parseLong(uin); - //retrieve the details - long toICQUin = Long.parseLong(uin); - MetaFullInfoRequest infoRequest = - new MetaFullInfoRequest( - Long.parseLong(ownerUin), - reqID, - toICQUin); + int reqID = requestID++; - UserInfoResponseRetriever responseRetriever = - new UserInfoResponseRetriever(reqID); + MetaFullInfoRequest infoRequest = + new MetaFullInfoRequest( + Long.parseLong(ownerUin), + reqID, + toICQUin); - icqProvider.getAimConnection().getInfoService().getOscarConnection() - .sendSnacRequest(infoRequest, responseRetriever); + UserInfoResponseRetriever responseRetriever = + new UserInfoResponseRetriever(reqID); + + icqProvider.getAimConnection().getInfoService().getOscarConnection() + .sendSnacRequest(infoRequest, responseRetriever); - responseRetriever.waitForLastInfo(60000); + responseRetriever.waitForLastInfo(60000); - List<GenericDetail> result = responseRetriever.result; + result = responseRetriever.result; + } + catch(Exception e) {} if (result == null) result = new LinkedList<GenericDetail>(); diff --git a/src/net/java/sip/communicator/impl/protocol/icq/OperationSetServerStoredContactInfoIcqImpl.java b/src/net/java/sip/communicator/impl/protocol/icq/OperationSetServerStoredContactInfoIcqImpl.java index 593b39c..34d4e9d 100644 --- a/src/net/java/sip/communicator/impl/protocol/icq/OperationSetServerStoredContactInfoIcqImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/icq/OperationSetServerStoredContactInfoIcqImpl.java @@ -115,10 +115,10 @@ public class OperationSetServerStoredContactInfoIcqImpl public Iterator<GenericDetail> getAllDetailsForContact(Contact contact) { assertConnected(); - + List<GenericDetail> res = infoRetreiver.getContactDetails(contact.getAddress()); - + if(contact.getImage() != null) { res.add(new ServerStoredDetails.ImageDetail( |