{"record":{"id":"a5c3d515d046f6d0","repo":"HMCL-dev/HMCL","slug":"neoforgeversion-mcversion-cannot-be-null","errorCode":null,"errorMessage":"NeoForgeVersion mcversion cannot be null.","messagePattern":"NeoForgeVersion mcversion cannot be null\\.","errorType":"validation","errorClass":"JsonParseException","httpStatus":null,"severity":"error","filePath":"HMCLCore/src/main/java/org/jackhuang/hmcl/download/neoforge/NeoForgeBMCLVersionList.java","lineNumber":106,"sourceCode":"        @SerializedName(\"mcversion\")\n        private final String mcVersion;\n\n        public NeoForgeVersion(String rawVersion, String version, String mcVersion) {\n            this.rawVersion = rawVersion;\n            this.version = version;\n            this.mcVersion = mcVersion;\n        }\n\n        @Override\n        public void validate() throws JsonParseException {\n            if (this.rawVersion == null) {\n                throw new JsonParseException(\"NeoForgeVersion rawVersion cannot be null.\");\n            }\n            if (this.version == null) {\n                throw new JsonParseException(\"NeoForgeVersion version cannot be null.\");\n            }\n            if (this.mcVersion == null) {\n                throw new JsonParseException(\"NeoForgeVersion mcversion cannot be null.\");\n            }\n        }\n    }\n}\n","sourceCodeStart":88,"sourceCodeEnd":111,"githubUrl":"https://github.com/HMCL-dev/HMCL/blob/24702dc5a0214034f4c27166d5fd30cad08cec19/HMCLCore/src/main/java/org/jackhuang/hmcl/download/neoforge/NeoForgeBMCLVersionList.java#L88-L111","documentation":"Final check in NeoForgeVersion.validate(): the Minecraft version this NeoForge build targets (`mcVersion`) must be non-null. Without it, HMCL can't map the NeoForge version to a game version, so the entry is rejected with JsonParseException.","triggerScenarios":"A BMCLAPI metadata entry lacking the Minecraft version field, validated during NeoForge version list loading for a specific mcVersion.","commonSituations":"Incomplete mirror metadata for brand-new NeoForge builds; schema drift in the BMCLAPI response; corrupted cached version JSON.","solutions":["Refresh the version list / clear mirror cache.","Switch mirror or metadata source.","Retry later while the mirror completes its sync.","Update HMCL if the metadata schema changed."],"exampleFix":"// Not caller-fixable; retry with another source:\nversionList.clearCache(mcVersion);\nversionList.loadVersionsAsync(mcVersion); // after switching mirror","handlingStrategy":"try-catch","validationCode":"if (entry.get(\"mcversion\") == null || entry.get(\"mcversion\").isJsonNull()) skip();","typeGuard":"if (version.getMcVersion() == null) continue;","tryCatchPattern":"try { versionList.loadVersions(mcVersion); }\ncatch (JsonParseException e) { UI.toast(\"Mirror metadata incomplete; retrying with official source\"); }","preventionTips":["Verify the metadata source returns mcversion for every entry.","Clear cache after switching mirrors.","Update HMCL when the BMCLAPI field names change."],"tags":["json","validation","neoforge","mirror"],"backgroundTag":"schema-validation-failed","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"}