From f038ad586f7ce44f0b1cdd9be573f641e96063df Mon Sep 17 00:00:00 2001 From: Juuz <6596629+Juuxel@users.noreply.github.com> Date: Wed, 29 Oct 2025 15:04:33 +0200 Subject: [PATCH] FabricModJsonFactory: Fix compilation error --- .../loom/util/fmj/FabricModJsonFactory.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonFactory.java b/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonFactory.java index d85ba8cd..5a70c310 100644 --- a/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonFactory.java +++ b/src/main/java/net/fabricmc/loom/util/fmj/FabricModJsonFactory.java @@ -144,14 +144,18 @@ public final class FabricModJsonFactory { File file = SourceSetHelper.findFirstFileInResource(FABRIC_MOD_JSON, project, sourceSets); if (file == null) { - // Try another mod metadata file if fabric.mod.json wasn't found. - final @Nullable ModMetadataFile modMetadata = ModMetadataFiles.fromSourceSets(project, sourceSets); + try { + // Try another mod metadata file if fabric.mod.json wasn't found. + final @Nullable ModMetadataFile modMetadata = ModMetadataFiles.fromSourceSets(project, sourceSets); - if (modMetadata != null) { - return new ModMetadataFabricModJson(modMetadata, new FabricModJsonSource.SourceSetSource(project, sourceSets)); + if (modMetadata != null) { + return new ModMetadataFabricModJson(modMetadata, new FabricModJsonSource.SourceSetSource(project, sourceSets)); + } + + return null; + } catch (IOException e) { + throw new UncheckedIOException(e); } - - return null; } try {