1
0
mirror of https://github.com/SKCraft/Launcher.git synced 2025-02-21 02:33:24 +01:00

NOISSUE Fix forge manifests with empty artifact URLs failing

This commit is contained in:
Henry Le Grys 2022-08-11 22:59:07 +01:00
parent 2a6c5ee015
commit 460070e82f

View File

@ -206,9 +206,10 @@ public class PackageBuilder {
if (!outputPath.exists()) {
Files.createParentDirs(outputPath);
boolean found = false;
boolean urlEmpty = artifact.getUrl().isEmpty();
// If URL doesn't end with a /, it might be the direct file
if (!artifact.getUrl().endsWith("/")) {
if (!urlEmpty && !artifact.getUrl().endsWith("/")) {
found = tryDownloadLibrary(library, artifact, artifact.getUrl(), outputPath);
}
@ -221,7 +222,7 @@ public class PackageBuilder {
}
// Assume artifact URL is a maven repository URL and try that
if (!found) {
if (!found && !urlEmpty) {
URL url = LauncherUtils.concat(url(artifact.getUrl()), artifact.getPath());
found = tryDownloadLibrary(library, artifact, url.toString(), outputPath);
}