Skip to content

Commit 39abdf1

Browse files
authored
[release/3.6] 修复启用代理身份认证且未设置密码时启动器崩溃的问题 (#4536)
#4465
1 parent 8df6563 commit 39abdf1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

HMCL/src/main/java/org/jackhuang/hmcl/setting/ProxyManager.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ private static Authenticator getAuthenticator() {
5959
String password = config().getProxyPass();
6060

6161
if (username != null || password != null)
62-
return new SimpleAuthenticator(username, password.toCharArray());
62+
return new SimpleAuthenticator(
63+
Lang.requireNonNullElse(username, ""),
64+
Lang.requireNonNullElse(password, "").toCharArray()
65+
);
6366
else
6467
return null;
6568
} else

0 commit comments

Comments
 (0)