From 4c8e5425e00fbe2ddb2c5d214644301c3a8eb1a2 Mon Sep 17 00:00:00 2001 From: Ryan Dowling Date: Wed, 27 Jul 2022 20:35:31 +1000 Subject: [PATCH] fix: issue with the forge library type adapter from 02d7b83 --- .vscode/launch.json | 2 +- .../java/com/atlauncher/data/minecraft/LibraryTypeAdapter.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index f24877ca..729003bd 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -9,7 +9,7 @@ "projectName": "ATLauncher", "cwd": "${workspaceFolder}/testLauncher", "preLaunchTask": "createTestLauncherDir", - "args": "--debug --disable-error-reporting --no-launcher-update" + "args": "--debug --debug-level=5 --disable-error-reporting --no-launcher-update" }, { "type": "java", diff --git a/src/main/java/com/atlauncher/data/minecraft/LibraryTypeAdapter.java b/src/main/java/com/atlauncher/data/minecraft/LibraryTypeAdapter.java index d9b29b4c..0188f812 100644 --- a/src/main/java/com/atlauncher/data/minecraft/LibraryTypeAdapter.java +++ b/src/main/java/com/atlauncher/data/minecraft/LibraryTypeAdapter.java @@ -40,7 +40,8 @@ public class LibraryTypeAdapter implements JsonDeserializer { } else { 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"); } }