Skip to content

Commit

Permalink
NOISSUE Fix forge manifests with empty artifact URLs failing
Browse files Browse the repository at this point in the history
  • Loading branch information
hedgehog1029 committed Aug 11, 2022
1 parent 2a6c5ee commit 460070e
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,10 @@ public void downloadLibraries(File librariesDir) throws IOException, Interrupted
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);
}

Expand All @@ -221,7 +222,7 @@ public void downloadLibraries(File librariesDir) throws IOException, Interrupted
}

// 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);
}
Expand Down

0 comments on commit 460070e

Please sign in to comment.