fix: issue with the forge library type adapter from 02d7b83

This commit is contained in:
Ryan Dowling 2022-07-27 20:35:31 +10:00
parent 7a97d6edab
commit 4c8e5425e0
No known key found for this signature in database
GPG key ID: 5539FCDB88950EFD
2 changed files with 3 additions and 2 deletions

2
.vscode/launch.json vendored
View file

@ -9,7 +9,7 @@
"projectName": "ATLauncher", "projectName": "ATLauncher",
"cwd": "${workspaceFolder}/testLauncher", "cwd": "${workspaceFolder}/testLauncher",
"preLaunchTask": "createTestLauncherDir", "preLaunchTask": "createTestLauncherDir",
"args": "--debug --disable-error-reporting --no-launcher-update" "args": "--debug --debug-level=5 --disable-error-reporting --no-launcher-update"
}, },
{ {
"type": "java", "type": "java",

View file

@ -40,7 +40,8 @@ public class LibraryTypeAdapter implements JsonDeserializer<Library> {
} else { } else {
library = new Gson().fromJson(object, Library.class); library = new Gson().fromJson(object, Library.class);
if (library.name.contains("forge") && library.downloads.artifact.url.endsWith("-launcher.jar")) { if (library.name.contains("forge") && library.downloads != null && library.downloads.artifact != null
&& library.downloads.artifact.url.endsWith("-launcher.jar")) {
library.downloads.artifact.url = library.downloads.artifact.url.replace("-launcher.jar", ".jar"); library.downloads.artifact.url = library.downloads.artifact.url.replace("-launcher.jar", ".jar");
} }
} }