Prevent errors when the full config is not set
This commit is contained in:
parent
a6007ec6cf
commit
372b3c231c
@ -118,7 +118,7 @@ public class BungeeCord
|
|||||||
String[] split = commandLine.trim().split(" ");
|
String[] split = commandLine.trim().split(" ");
|
||||||
String commandName = split[0].toLowerCase();
|
String commandName = split[0].toLowerCase();
|
||||||
Command command = commandMap.get(commandName);
|
Command command = commandMap.get(commandName);
|
||||||
if (command != null && !config.disabledCommands.contains(commandName))
|
if (command != null && (config.disabledCommands == null || !config.disabledCommands.contains(commandName)))
|
||||||
{
|
{
|
||||||
String[] args = Arrays.copyOfRange(split, 1, split.length);
|
String[] args = Arrays.copyOfRange(split, 1, split.length);
|
||||||
try
|
try
|
||||||
|
@ -174,6 +174,9 @@ public class Configuration
|
|||||||
{
|
{
|
||||||
throw new IllegalArgumentException("Server '" + defaultServerName + "' not defined");
|
throw new IllegalArgumentException("Server '" + defaultServerName + "' not defined");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (forcedServers != null)
|
||||||
|
{
|
||||||
for (String server : forcedServers.values())
|
for (String server : forcedServers.values())
|
||||||
{
|
{
|
||||||
if (!servers.containsKey(server))
|
if (!servers.containsKey(server))
|
||||||
@ -181,6 +184,7 @@ public class Configuration
|
|||||||
throw new IllegalArgumentException("Forced server " + server + " is not defined in servers");
|
throw new IllegalArgumentException("Forced server " + server + " is not defined in servers");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
reconnect.createNewFile();
|
reconnect.createNewFile();
|
||||||
try (FileInputStream recon = new FileInputStream(reconnect))
|
try (FileInputStream recon = new FileInputStream(reconnect))
|
||||||
|
Loading…
Reference in New Issue
Block a user