Skip to content

Commit 8d6f20c

Browse files
committed
fix(modpack): 修复本地模组包安装任务为空时的异常崩溃
- 添加空值检查避免在task为null时调用installModpack方法 - 防止因空指针异常导致的程序崩溃 - 确保只有在任务存在时才执行模组包安装流程
1 parent cbbd48d commit 8d6f20c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

FCL/src/main/java/com/tungsten/fcl/ui/download/modpack/LocalModpackPage.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ protected void onInstall() {
165165
task = ModpackInstaller.getModpackInstallTask(getContext(), profile, updateVersion, modpackFile, manifest, name);
166166
}
167167
}
168-
ModpackInstaller.installModpack(getContext(), task, updateVersion != null);
168+
if (task != null)
169+
ModpackInstaller.installModpack(getContext(), task, updateVersion != null);
169170
}
170171

171172
@Override

0 commit comments

Comments
 (0)