mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-09 20:06:39 -04:00
Ignore IllegalStateException(Shutdown in Progress)
This commit is contained in:
parent
ac66dfe476
commit
2ece71aae3
@ -50,10 +50,13 @@ public class DefaultPlugin implements IPlugin {
|
||||
auths.add(new OfflineAuthenticator(clientToken));
|
||||
auths.add(new YggdrasilAuthenticator(clientToken));
|
||||
|
||||
try {
|
||||
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
|
||||
for (IAuthenticator i : auths)
|
||||
Settings.getInstance().setAuthenticatorConfig(i.id(), i.onSaveSettings());
|
||||
}));
|
||||
} catch(IllegalStateException ignore) { // Shutdown in progress
|
||||
}
|
||||
for (IAuthenticator i : auths) {
|
||||
i.onLoadSettings(Settings.getInstance().getAuthenticatorConfig(i.id()));
|
||||
apply.accept(i);
|
||||
|
Loading…
x
Reference in New Issue
Block a user