Commit 5f6c892d authored by ics's avatar ics

Corrected unexpected empty string in ChatEvent.formatEndPoint

parent 74dacd7d
......@@ -91,7 +91,10 @@ public class ChatEvent {
public static String formatEndPoint(String endPoint) {
String formattedEndPoint = endPoint.replace("tcp://", "");
formattedEndPoint = formattedEndPoint.substring(0, formattedEndPoint.indexOf(":"));
int index = formattedEndPoint.indexOf(":");
if (index != -1) {
formattedEndPoint = formattedEndPoint.substring(0, index);
}
return formattedEndPoint;
}
......
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