mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-25 12:13:23 -04:00
[release/3.6] 修复导入异常格式的数据包时启动器崩溃的问题 (#4425)
https://github.com/HMCL-dev/HMCL/pull/4152
This commit is contained in:
parent
ff3b486f58
commit
3096f933af
@ -132,7 +132,7 @@ public class Datapack {
|
||||
try {
|
||||
PackMcMeta pack = JsonUtils.fromNonNullJson(FileUtils.readText(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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user