Skip to content

Commit 69a6af5

Browse files
committed
fix: Deploader crash when fetching mcmod.info details
Closes: #46
1 parent fabf4f3 commit 69a6af5

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
group = "com.falsepattern"
66

77
//bump this after ANY change to the deploader!
8-
val deploaderVersion = 4
8+
val deploaderVersion = 5
99

1010
minecraft_fp {
1111
java {

src/deploader/java/com/falsepattern/deploader/DependencyLoaderImpl.java

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -298,22 +298,24 @@ public static CompletableFuture<Void> loadLibrariesAsync(Library... libraries) {
298298

299299
@SneakyThrows
300300
private static void readMCMod(InputStream input, String name) {
301-
val meta = MetadataCollection.from(input, name);
302-
val modList = (ModMetadata[])metadataCollectionModListAccessor.get(meta);
303-
for (val mod: modList) {
304-
val id = mod.modId;
305-
if (id != null) {
306-
val versionStr = mod.version;
307-
final Version version;
308-
if (versionStr != null) {
309-
version = Version.parse(versionStr);
310-
} else {
311-
version = new RawVersion("unknown");
301+
try {
302+
val meta = MetadataCollection.from(input, name);
303+
val modList = (ModMetadata[]) metadataCollectionModListAccessor.get(meta);
304+
for (val mod : modList) {
305+
val id = mod.modId;
306+
if (id != null) {
307+
val versionStr = mod.version;
308+
final Version version;
309+
if (versionStr != null) {
310+
version = Version.parse(versionStr);
311+
} else {
312+
version = new RawVersion("unknown");
313+
}
314+
loadedModIds.put(id, version);
315+
loadedModIdMods.put(id, name);
312316
}
313-
loadedModIds.put(id, version);
314-
loadedModIdMods.put(id, name);
315317
}
316-
}
318+
} catch (Throwable ignored) {}
317319
}
318320

319321
private static boolean scanForDepSpecs(URL source, List<URL> output, List<URL> jijURLs) {

0 commit comments

Comments
 (0)