Fix #4146: 修复导入异常格式的数据包时启动器崩溃的问题 (#4152)

This commit is contained in:
Glavo 2025-07-31 15:04:56 +08:00 committed by GitHub
parent 5703377626
commit 9bcf95287a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -132,7 +132,7 @@ public class Datapack {
try {
PackMcMeta pack = JsonUtils.fromNonNullJson(Files.readString(mcmeta), PackMcMeta.class);
Platform.runLater(() -> info.add(new Pack(path, FileUtils.getNameWithoutExtension(path), pack.getPackInfo().getDescription(), this)));
} catch (IOException | JsonParseException e) {
} catch (Exception e) {
LOG.warning("Failed to read datapack " + path, e);
}
} else {
@ -144,7 +144,7 @@ public class Datapack {
public void loadFromDir() {
try {
loadFromDir(path);
} catch (IOException e) {
} catch (Exception e) {
LOG.warning("Failed to read datapacks " + path, e);
}
}