Check for illegal characters of the HMCL directory path

This commit is contained in:
Glavo
2021-12-24 22:53:32 +08:00
committed by Yuhui Huang
parent cfa1eedae7
commit e65f664821
4 changed files with 7 additions and 0 deletions

View File

@@ -70,6 +70,10 @@ public final class Launcher extends Application {
Main.showErrorAndExit(i18n("fatal.config_loading_failure", Paths.get("").toAbsolutePath().normalize()));
}
if (Metadata.HMCL_DIRECTORY.toAbsolutePath().toString().indexOf('=') >= 0) {
Main.showWarningAndContinue(i18n("fatal.illegal_char"));
}
// runLater to ensure ConfigHolder.init() finished initialization
Platform.runLater(() -> {
// When launcher visibility is set to "hide and reopen" without Platform.implicitExit = false,