Commit af3ab023 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Ignore invalid admin JIDs and log a warning.

git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@3027 b35dd754-fafc-0310-a699-88a17e54d16e
parent 4907d15a
......@@ -222,7 +222,14 @@ public class XMPPServer {
StringTokenizer tokenizer = new StringTokenizer(usernames, ",");
while (tokenizer.hasMoreTokens()) {
String username = tokenizer.nextToken();
admins.add(createJID(username, null));
try {
admins.add(createJID(username, null));
}
catch (IllegalArgumentException e) {
// Ignore usernames that when appended @server.com result in an invalid JID
Log.warn("Invalid username found in authorizedUsernames at jive-messenger.xml: " +
username, e);
}
}
// Add bare JIDs of users that are admins (may include remote users)
......@@ -231,7 +238,12 @@ public class XMPPServer {
tokenizer = new StringTokenizer(jids, ",");
while (tokenizer.hasMoreTokens()) {
String jid = tokenizer.nextToken();
admins.add(new JID(jid));
try {
admins.add(new JID(jid));
}
catch (IllegalArgumentException e) {
Log.warn("Invalid JID found in authorizedJIDs at jive-messenger.xml: " + jid, e);
}
}
return admins;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment