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
This commit is contained in:
Holger Bergunde
2011-04-18 13:30:52 +00:00
committed by holger.bergunde
parent 8f036a770d
commit e512fe6066

View File

@ -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);