{"record":{"id":"31ccd5fad0b78d46","repo":"HMCL-dev/HMCL","slug":"theme-name-is-empty","errorCode":null,"errorMessage":"Theme name is empty: ","messagePattern":"Theme name is empty: ","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"HMCL/src/main/java/org/jackhuang/hmcl/theme/Theme.java","lineNumber":73,"sourceCode":"        @Nullable String icon,\n        ThemeAppearance appearance,\n        @Unmodifiable List<ThemeOverride> overrides) {\n\n    /// Creates a theme.\n    ///\n    /// @param id          the stable theme identifier inside its pack, or `null` for an unnamed single-theme pack\n    /// @param name        the localized display name, or `null` for an unnamed single-theme pack\n    /// @param authors     authors of this specific theme\n    /// @param description the optional localized description\n    /// @param icon        the optional theme-pack relative icon path\n    /// @param appearance  the default appearance fields\n    /// @param overrides   conditional appearance patches applied in declaration order\n    public Theme {\n        if (id != null) {\n            id = ThemePackManifest.requireThemeId(id);\n        }\n        if (name != null && name.mayBeEmpty()) {\n            throw new IllegalArgumentException(\"Theme name is empty: \" + name);\n        }\n        if (icon != null) {\n            icon = ThemePackAsset.normalizeEntryName(icon);\n        }\n        authors = List.copyOf(authors);\n        Objects.requireNonNull(appearance);\n        overrides = List.copyOf(overrides);\n    }\n\n    /// Parses a theme from JSON.\n    ///\n    /// @param object          the theme JSON object\n    /// @param requireIdentity whether the theme must declare an explicit ID and name\n    /// @return the parsed theme\n    /// @throws JsonParseException if required identity fields are missing or malformed\n    static Theme fromJson(JsonObject object, boolean requireIdentity) throws JsonParseException {\n        Objects.requireNonNull(object);\n","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/HMCL-dev/HMCL/blob/24702dc5a0214034f4c27166d5fd30cad08cec19/HMCL/src/main/java/org/jackhuang/hmcl/theme/Theme.java#L55-L91","documentation":"Fires when a theme's display name is absent or blank. The name is required for the theme to be selectable and rendered in the theme picker, so a nameless theme entry (beyond the explicit null-name single-theme pack case) is rejected as malformed. The input at fault is a theme JSON object whose 'name' field is empty.","triggerScenarios":"Thrown at HMCL/src/main/java/org/jackhuang/hmcl/theme/Theme.java:73 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add a non-empty localized 'name' object to the theme's manifest entry.","Remove or fix the malformed theme pack so its themes all declare display names.","If the pack is intended to be a single unnamed theme, omit the id/name fields entirely rather than supplying an empty name."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}