From e512fe6066e68add999bdadb41a00d492806ec91 Mon Sep 17 00:00:00 2001 From: Holger Bergunde Date: Mon, 18 Apr 2011 13:30:52 +0000 Subject: [PATCH] SPARK-1286 fixes problem. if there is no contactitem available on your roster when starting a chat (usual case when searching for someone), ignore it and try to get the vcard from the server git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@12260 b35dd754-fafc-0310-a699-88a17e54d16e --- .../org/jivesoftware/sparkimpl/profile/VCardManager.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/java/org/jivesoftware/sparkimpl/profile/VCardManager.java b/src/java/org/jivesoftware/sparkimpl/profile/VCardManager.java index 096acdcc..1030c509 100644 --- a/src/java/org/jivesoftware/sparkimpl/profile/VCardManager.java +++ b/src/java/org/jivesoftware/sparkimpl/profile/VCardManager.java @@ -428,8 +428,9 @@ public class VCardManager { if (vcard.getNickName() != null && vcard.getNickName().length() > 0) { // update nickname. - ContactItem item = SparkManager.getWorkspace().getContactList().getContactItemByJID(jid); - item.setNickname(vcard.getNickName()); + //if the conract isn't on your list + ContactItem item = SparkManager.getWorkspace().getContactList().getContactItemByJID(jid); + if (item!= null)item.setNickname(vcard.getNickName()); // TODO: this doesn't work if someone removes his nickname. If we remove it in that case, it will cause problems with people using another way to manage their nicknames. } vcards.put(jid, vcard);