Add a few extra null checks into ProtocolDetectorService

Under certain conditions these can be null.
This commit is contained in:
Myles 2017-11-26 13:45:39 +00:00
parent ab1a586b4c
commit 12c21c9b0a

View File

@ -54,7 +54,7 @@ public class ProtocolDetectorService implements Runnable {
serverInfo.ping(new Callback<ServerPing>() {
@Override
public void done(ServerPing serverPing, Throwable throwable) {
if (throwable == null) {
if (throwable == null && serverPing != null && serverPing.getVersion() != null) {
detectedProtocolIds.put(key, serverPing.getVersion().getProtocol());
if (((BungeeConfigAPI) Via.getConfig()).isBungeePingSave()) {
Map<String, Integer> servers = ((BungeeConfigAPI) Via.getConfig()).getBungeeServerProtocols();
@ -69,7 +69,6 @@ public class ProtocolDetectorService implements Runnable {
}
// Save
Via.getPlatform().getConfigurationProvider().saveConfig();
}
}
}