From 122d474eebdb01e2c4a7c60152fcc225881943ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BE=9E=E5=BA=90?= <109708109+CiiLu@users.noreply.github.com> Date: Tue, 30 Jun 2026 20:52:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20#5516=20Java=20=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E5=AE=89=E8=A3=85=E9=83=A8=E5=88=86=20Java?= =?UTF-8?q?=20(#6249)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Glavo --- .../org/jackhuang/hmcl/ui/main/JavaDownloadDialog.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/JavaDownloadDialog.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/JavaDownloadDialog.java index 4605186ce8..18bb38c216 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/JavaDownloadDialog.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/main/JavaDownloadDialog.java @@ -17,7 +17,10 @@ */ package org.jackhuang.hmcl.ui.main; -import com.jfoenix.controls.*; +import com.jfoenix.controls.JFXButton; +import com.jfoenix.controls.JFXCheckBox; +import com.jfoenix.controls.JFXComboBox; +import com.jfoenix.controls.JFXDialogLayout; import javafx.beans.InvalidationListener; import javafx.beans.binding.Bindings; import javafx.beans.property.ObjectProperty; @@ -376,7 +379,8 @@ public final class JavaDownloadDialog extends StackPane { throw new IOException("Illegal result: " + json); DiscoRemoteFileInfo fileInfo = result.getResult().get(0); - if (!fileInfo.getChecksumType().equals("sha1") && !fileInfo.getChecksumType().equals("sha256")) + if (StringUtils.isNotBlank(fileInfo.getChecksumType()) + && !fileInfo.getChecksumType().equals("sha1") && !fileInfo.getChecksumType().equals("sha256") && !fileInfo.getChecksumType().equals("md5")) throw new IOException("Unsupported checksum type: " + fileInfo.getChecksumType()); if (StringUtils.isBlank(fileInfo.getDirectDownloadUri())) throw new IOException("Missing download URI: " + json); @@ -399,7 +403,7 @@ public final class JavaDownloadDialog extends StackPane { return new FileDownloadTask.IntegrityCheck(fileInfo.getChecksumType(), checksum); }); else - throw new IOException("Unable to get checksum for file"); + getIntegrityCheck = Task.completed(null); return getIntegrityCheck .thenComposeAsync(integrityCheck ->