fixed array out of bounds

This commit is contained in:
Daniel Gultsch 2014-03-25 17:08:52 +01:00
parent 2ab757d6a2
commit 10f2231bcf
1 changed files with 4 additions and 1 deletions

View File

@ -101,7 +101,9 @@ public class MucOptions {
} }
public void processPacket(PresencePacket packet) { public void processPacket(PresencePacket packet) {
String name = packet.getAttribute("from").split("/")[1]; String[] fromParts = packet.getFrom().split("/");
if (fromParts.length>=2) {
String name = fromParts[1];
String type = packet.getAttribute("type"); String type = packet.getAttribute("type");
if (type==null) { if (type==null) {
User user = new User(); User user = new User();
@ -143,6 +145,7 @@ public class MucOptions {
} }
} }
} }
}
} }
public List<User> getUsers() { public List<User> getUsers() {