From 460070e82f42e41565d38cfe092bbe0f6ff1db0a Mon Sep 17 00:00:00 2001 From: Henry Le Grys Date: Thu, 11 Aug 2022 22:59:07 +0100 Subject: [PATCH] NOISSUE Fix forge manifests with empty artifact URLs failing --- .../java/com/skcraft/launcher/builder/PackageBuilder.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/launcher-builder/src/main/java/com/skcraft/launcher/builder/PackageBuilder.java b/launcher-builder/src/main/java/com/skcraft/launcher/builder/PackageBuilder.java index dd208777d..914ff3c27 100644 --- a/launcher-builder/src/main/java/com/skcraft/launcher/builder/PackageBuilder.java +++ b/launcher-builder/src/main/java/com/skcraft/launcher/builder/PackageBuilder.java @@ -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); } @@ -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); }