mirror of
https://github.com/filoghost/HolographicDisplays.git
synced 2024-11-27 12:55:49 +01:00
Fix IndexOutOfBoundsException
This commit is contained in:
parent
af038ac93f
commit
8f81052370
@ -75,10 +75,12 @@ public class BungeeServerInfo {
|
||||
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