mirror of
https://github.com/filoghost/HolographicDisplays.git
synced 2024-12-29 12:17:36 +01:00
Fix IndexOutOfBoundsException
This commit is contained in:
parent
af038ac93f
commit
8f81052370
@ -74,11 +74,13 @@ public class BungeeServerInfo {
|
||||
this.motd2 = "";
|
||||
return;
|
||||
}
|
||||
|
||||
if (motd.contains("\n")) {
|
||||
String[] split = motd.split("\n");
|
||||
this.motd1 = Configuration.pingerTrimMotd ? split[0].trim() : split[0];
|
||||
this.motd2 = Configuration.pingerTrimMotd ? split[1].trim() : split[1];
|
||||
|
||||
int separatorIndex = motd.indexOf("\n");
|
||||
if (separatorIndex >= 0) {
|
||||
String line1 = motd.substring(0, separatorIndex);
|
||||
String line2 = motd.substring(separatorIndex + 1);
|
||||
this.motd1 = Configuration.pingerTrimMotd ? line1.trim() : line1;
|
||||
this.motd2 = Configuration.pingerTrimMotd ? line2.trim() : line2;
|
||||
} else {
|
||||
this.motd1 = Configuration.pingerTrimMotd ? motd.trim() : motd;
|
||||
this.motd2 = "";
|
||||
|
Loading…
Reference in New Issue
Block a user