We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8df6563 commit e885a8cCopy full SHA for e885a8c
1 file changed
HMCL/src/main/java/org/jackhuang/hmcl/setting/ProxyManager.java
@@ -25,6 +25,7 @@
25
import java.net.*;
26
import java.util.Collections;
27
import java.util.List;
28
+import java.util.Objects;
29
30
import static org.jackhuang.hmcl.setting.ConfigHolder.config;
31
import static org.jackhuang.hmcl.util.logging.Logger.LOG;
@@ -59,7 +60,10 @@ private static Authenticator getAuthenticator() {
59
60
String password = config().getProxyPass();
61
62
if (username != null || password != null)
- return new SimpleAuthenticator(username, password.toCharArray());
63
+ return new SimpleAuthenticator(
64
+ Objects.requireNonNullElse(username, ""),
65
+ Objects.requireNonNullElse(password, "").toCharArray()
66
+ );
67
else
68
return null;
69
} else
0 commit comments