fix: NPE
This commit is contained in:
@@ -138,6 +138,7 @@ public class DefaultLauncher extends Launcher {
|
||||
Proxy proxy = options.getProxy();
|
||||
if (proxy != null && StringUtils.isBlank(options.getProxyUser()) && StringUtils.isBlank(options.getProxyPass())) {
|
||||
InetSocketAddress address = (InetSocketAddress) options.getProxy().address();
|
||||
if (address != null) {
|
||||
String host = address.getHostString();
|
||||
int port = address.getPort();
|
||||
if (proxy.type() == Proxy.Type.HTTP) {
|
||||
@@ -150,6 +151,7 @@ public class DefaultLauncher extends Launcher {
|
||||
res.add("-DsocksProxyPort=" + port);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LinkedList<String> classpath = new LinkedList<>();
|
||||
for (Library library : version.getLibraries())
|
||||
@@ -202,6 +204,7 @@ public class DefaultLauncher extends Launcher {
|
||||
|
||||
if (options.getProxy() != null) {
|
||||
InetSocketAddress address = (InetSocketAddress) options.getProxy().address();
|
||||
if (address != null) {
|
||||
res.add("--proxyHost");
|
||||
res.add(address.getHostString());
|
||||
res.add("--proxyPort");
|
||||
@@ -213,6 +216,7 @@ public class DefaultLauncher extends Launcher {
|
||||
res.add(options.getProxyPass());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(options.getMinecraftArgs()))
|
||||
res.addAllWithoutParsing(StringUtils.tokenize(options.getMinecraftArgs()));
|
||||
|
||||
Reference in New Issue
Block a user