fixed array out of bounds in isMuc

This commit is contained in:
iNPUTmice 2014-07-03 11:32:54 +02:00
parent aa1665e359
commit e02ae4cde2

View File

@ -485,8 +485,11 @@ public class ContactsActivity extends XmppActivity {
} }
private boolean isMuc(Contact contact) { private boolean isMuc(Contact contact) {
String server = contact.getJid().split("@")[1]; String[] parts = contact.getJid().split("@");
return getMucServers().contains(server); if (parts.length != 2) {
return false;
}
return getMucServers().contains(parts[1]);
} }
public void startConversation(Contact contact, Account account, boolean muc) { public void startConversation(Contact contact, Account account, boolean muc) {