Skip to content

Commit 3096f93

Browse files
authored
[release/3.6] 修复导入异常格式的数据包时启动器崩溃的问题 (#4425)
#4152
1 parent ff3b486 commit 3096f93

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

HMCLCore/src/main/java/org/jackhuang/hmcl/mod/Datapack.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public void loadFromZip() throws IOException {
132132
try {
133133
PackMcMeta pack = JsonUtils.fromNonNullJson(FileUtils.readText(mcmeta), PackMcMeta.class);
134134
Platform.runLater(() -> info.add(new Pack(path, FileUtils.getNameWithoutExtension(path), pack.getPackInfo().getDescription(), this)));
135-
} catch (IOException | JsonParseException e) {
135+
} catch (Exception e) {
136136
LOG.warning("Failed to read datapack " + path, e);
137137
}
138138
} else {
@@ -144,7 +144,7 @@ public void loadFromZip() throws IOException {
144144
public void loadFromDir() {
145145
try {
146146
loadFromDir(path);
147-
} catch (IOException e) {
147+
} catch (Exception e) {
148148
LOG.warning("Failed to read datapacks " + path, e);
149149
}
150150
}

0 commit comments

Comments
 (0)