{"record":{"id":"07249ad4dff8d28c","repo":"HMCL-dev/HMCL","slug":"empty-components","errorCode":null,"errorMessage":"Empty components.","messagePattern":"Empty components\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"HMCLCore/src/main/java/org/jackhuang/hmcl/modpack/multimc/MultiMCInstancePatch.java","lineNumber":252,"sourceCode":"public static ResolvedInstance resolveArtifact(List<MultiMCInstancePatch> patches, GameInstanceID instanceId) {\n    if (patches.isEmpty()) {\n        throw new IllegalArgumentException(\"Empty components.\");\n    }\n\n    for (MultiMCInstancePatch patch : patches) {\n        Objects.requireNonNull(patch, \"patch\");\n\n        if (patch.getFormatVersion() != 1) {\n            throw new UnsupportedOperationException(\n                    String.format(\"Unsupported JSON-Patch[%s] format version: %d\", patch.getID(), patch.getFormatVersion())\n            );\n        }\n    }","sourceCodeStart":234,"sourceCodeEnd":270,"githubUrl":"https://github.com/HMCL-dev/HMCL/blob/24702dc5a0214034f4c27166d5fd30cad08cec19/HMCLCore/src/main/java/org/jackhuang/hmcl/modpack/multimc/MultiMCInstancePatch.java#L234-L270","documentation":"resolveArtifact guard: the list of MultiMC component patches is empty, so there is nothing to resolve into an official version scheme and the conversion cannot proceed. Generic validation of the parsed MultiMC instance components.","triggerScenarios":"Calling MultiMCInstancePatch.resolveArtifact(List.of(), instanceId), or passing a patches list that ended up empty after collecting mmc-pack.json components.","commonSituations":"Importing a MultiMC instance whose mmc-pack.json has an empty components array (already rejected earlier) or whose patch files failed to load and were filtered out.","solutions":["Ensure the instance archive contains mmc-pack.json with at least one component","Add the mandatory net.minecraft (and net.fabricmc etc.) component patches","Re-export the instance from MultiMC/Prism so patches are included"],"exampleFix":"// before\nresolveArtifact(Collections.emptyList(), instanceId); // throws\n// after\nList<MultiMCInstancePatch> patches = readPatchesFrom(mmcPack); // non-empty\nresolveArtifact(patches, instanceId);","handlingStrategy":"validation","validationCode":"if (patches == null || patches.isEmpty()) throw new IllegalArgumentException(\"Instance has no components; mmc-pack.json is missing or empty\");","typeGuard":null,"tryCatchPattern":"try { resolveArtifact(patches, id); } catch (IllegalArgumentException e) { /* abort import with user-facing message */ }","preventionTips":["Ensure mmc-pack.json exists with a non-empty components array before import","Re-export instances from MultiMC/Prism if component files are missing"],"tags":["multimc","components","empty-list","illegal-argument"],"backgroundTag":"empty-required-field","analyzedSha":"24702dc5a0214034f4c27166d5fd30cad08cec19","analyzedAt":"2026-09-10T12:36:46.680Z","contentChangedAt":"2026-09-10T12:36:46.680Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}