{"record":{"id":"b85ca4cef8d7d92b","repo":"HMCL-dev/HMCL","slug":"missing-author-name","errorCode":null,"errorMessage":"Missing author name: ","messagePattern":"Missing author name: ","errorType":"validation","errorClass":"JsonParseException","httpStatus":null,"severity":"error","filePath":"HMCL/src/main/java/org/jackhuang/hmcl/theme/ThemePackAuthor.java","lineNumber":102,"sourceCode":"    public static @Nullable ThemePackAuthor fromJson(@Nullable JsonElement json) throws JsonParseException {\n        if (json == null || json instanceof JsonNull)\n            return null;\n\n        if (json instanceof JsonPrimitive primitive && primitive.isString()) {\n            try {\n                return new ThemePackAuthor(LocalizedText.plain(primitive.getAsString()));\n            } catch (IllegalArgumentException e) {\n                throw new JsonParseException(e);\n            }\n        }\n\n        if (!(json instanceof JsonObject jsonObject)) {\n            throw new JsonParseException(\"Theme-pack author must be an object or a string\");\n        }\n\n        JsonElement nameJson = jsonObject.get(\"name\");\n        if (nameJson == null) {\n            throw new JsonParseException(\"Missing author name: \" + json);\n        }\n\n        LocalizedText name = LocalizedText.fromJson(nameJson);\n        if (name == null) {\n            throw new JsonParseException(\"The author name is null\");\n        }\n\n        try {\n            return new ThemePackAuthor(name);\n        } catch (IllegalArgumentException e) {\n            throw new JsonParseException(e);\n        }\n    }\n\n    /// Creates theme-pack author metadata.\n    ///\n    /// @param name the localized author display name\n    public ThemePackAuthor {","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/HMCL-dev/HMCL/blob/24702dc5a0214034f4c27166d5fd30cad08cec19/HMCL/src/main/java/org/jackhuang/hmcl/theme/ThemePackAuthor.java#L84-L120","documentation":"Thrown by ThemePackAuthor.fromJson when the author JSON object is present but has no \"name\" key. The object form of an author must carry a name (a string or LocalizedText); the library refuses to construct an author without one.","triggerScenarios":"Deserializing an author object like {\"author\": {}} or {\"author\": {\"contact\":\"x\"}} — i.e. a JsonObject without a \"name\" member — through ThemePackAuthor.fromJson.","commonSituations":"Hand-written manifests where the author object only contains optional-looking fields, manifests migrated from other formats using different key names (e.g. \"authorName\"), or truncated/partial JSON edits.","solutions":["Add a \"name\" key to the author object: {\"author\": {\"name\": \"Alice\"}}.","If you meant a simple author, replace the object with a plain string: {\"author\": \"Alice\"}.","Rename misspelled keys (authorName, displayName) to \"name\".","Validate the manifest JSON against the expected author schema before distributing the pack."],"exampleFix":"// before\n{\"author\": {\"website\": \"https://example.com\"}}\n// after\n{\"author\": {\"name\": \"Alice\", \"website\": \"https://example.com\"}}","handlingStrategy":"validation","validationCode":"boolean hasAuthorName(JsonObject author) {\n    return author != null && author.has(\"name\") && !author.get(\"name\").isJsonNull();\n}","typeGuard":null,"tryCatchPattern":"try { ThemePackAuthor a = ThemePackAuthor.fromJson(authorJson); } catch (JsonParseException e) { if (e.getMessage().startsWith(\"Missing author name\")) fixManifest(); throw e; }","preventionTips":["Check every author object has a \"name\" key before packaging","Use a schema validator requiring {\"name\": string|object}","Avoid key renames like authorName; stick to \"name\""],"tags":["json","theme-pack","manifest","missing-field"],"backgroundTag":"missing-required-config-field","analyzedSha":"24702dc5a0214034f4c27166d5fd30cad08cec19","analyzedAt":"2026-09-10T12:36:46.680Z","contentChangedAt":"2026-09-10T12:36:46.680Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}