fix: Deploader crash when fetching mcmod.info details

Closes: https://github.com/FalsePattern/FalsePatternLib/issues/46
This commit is contained in:
FalsePattern committed 2025-11-20 16:32:00 +01:00
1 parent fabf4f3fb5
commit 69a6af5c92
2 files changed
+17 -15

No files matched your search

+1 -1
View File
@@ -5,7 +5,7 @@ plugins {
group = "com.falsepattern"
//bump this after ANY change to the deploader!
val deploaderVersion = 4
val deploaderVersion = 5
minecraft_fp {
java {
@@ -298,22 +298,24 @@ public class DependencyLoaderImpl {
@SneakyThrows
private static void readMCMod(InputStream input, String name) {
val meta = MetadataCollection.from(input, name);
val modList = (ModMetadata[])metadataCollectionModListAccessor.get(meta);
for (val mod: modList) {
val id = mod.modId;
if (id != null) {
val versionStr = mod.version;
final Version version;
if (versionStr != null) {
version = Version.parse(versionStr);
} else {
version = new RawVersion("unknown");
try {
val meta = MetadataCollection.from(input, name);
val modList = (ModMetadata[]) metadataCollectionModListAccessor.get(meta);
for (val mod : modList) {
val id = mod.modId;
if (id != null) {
val versionStr = mod.version;
final Version version;
if (versionStr != null) {
version = Version.parse(versionStr);
} else {
version = new RawVersion("unknown");
}
loadedModIds.put(id, version);
loadedModIdMods.put(id, name);
}
loadedModIds.put(id, version);
loadedModIdMods.put(id, name);
}
}
} catch (Throwable ignored) {}
}
private static boolean scanForDepSpecs(URL source, List<URL> output, List<URL> jijURLs) {