修复 ModrinthRemoteModRepository::getRemoteVersionByLocalFile 未捕获 NoSuchFileException 的问题 (#3735)

---------

Co-authored-by: Zkitefly <2573874409@qq.com>
This commit is contained in:
Glavo 2025-03-11 21:58:18 +08:00 committed by GitHub
parent 7efbbefdcf
commit bdaf72fe2f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -31,6 +31,7 @@ import org.jackhuang.hmcl.util.io.ResponseCodeException;
import org.jetbrains.annotations.Nullable;
import java.io.IOException;
import java.nio.file.NoSuchFileException;
import java.nio.file.Path;
import java.time.Instant;
import java.util.*;
@ -113,6 +114,8 @@ public final class ModrinthRemoteModRepository implements RemoteModRepository {
} else {
throw e;
}
} catch (NoSuchFileException e) {
return Optional.empty();
}
}