{"record":{"id":"089b38e87f7b0309","repo":"HMCL-dev/HMCL","slug":"theme-pack-value-is-missing-name","errorCode":null,"errorMessage":"Theme pack value is missing: ${name}","messagePattern":"Theme pack value is missing: (.+?)","errorType":"validation","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"HMCL/src/main/java/org/jackhuang/hmcl/theme/ThemePackManager.java","lineNumber":1609,"sourceCode":"        if (BuiltinBackground.fromId(normalizedId) != null) {\n            return normalizedId;\n        }\n        throw new IOException(\"Theme packs cannot reference built-in wallpaper: \" + normalizedId);\n    }\n\n    /// Parses a serialized JavaFX paint value.\n    private static Paint parsePaint(String value) throws IOException {\n        try {\n            return Paint.valueOf(value);\n        } catch (IllegalArgumentException e) {\n            throw new IOException(\"Invalid theme background paint: \" + value, e);\n        }\n    }\n\n    /// Returns a non-blank string value.\n    private static String requireNonBlank(@Nullable String value, String name) throws IOException {\n        if (StringUtils.isBlank(value)) {\n            throw new IOException(\"Theme pack value is missing: \" + name);\n        }\n        return value.trim();\n    }\n\n    /// Sanitizes one path segment used for exported asset files.\n    private static String sanitizePathSegment(String value) {\n        String sanitized = value.trim().replaceAll(\"[^A-Za-z0-9._-]\", \"_\");\n        if (sanitized.isBlank()) {\n            return \"_\";\n        }\n        return sanitized;\n    }\n}\n","sourceCodeStart":1591,"sourceCodeEnd":1623,"githubUrl":"https://github.com/HMCL-dev/HMCL/blob/24702dc5a0214034f4c27166d5fd30cad08cec19/HMCL/src/main/java/org/jackhuang/hmcl/theme/ThemePackManager.java#L1591-L1623","documentation":"Thrown by requireNonBlank, the shared validator for mandatory theme-pack string values, when a required manifest value is null, empty, or whitespace-only. The message names the missing field so the manifest author can locate it.","triggerScenarios":"Any theme-pack parse/resolve path calling requireNonBlank(value, name) — e.g. background.networkImageUrl with \"background.url\" — where the value is blank.","commonSituations":"Manifest keys present but with empty string values (\"url\": \"\"); whitespace-only values after copy/paste; fields omitted entirely then read as null; template placeholders like \"<your-url-here>\" left unfilled would not trigger this (not blank) but empty ones will.","solutions":["Fill in the named manifest field with a non-blank value (the message tells you which key, e.g. background.url).","Remove surrounding whitespace or stray quotes/commas that leave the value empty after JSON parsing.","Validate the manifest JSON for empty strings before loading it into the launcher."],"exampleFix":"// before\n\"background\": { \"url\": \"\" }\n// after\n\"background\": { \"url\": \"https://example.com/wall.png\" }","handlingStrategy":"validation","validationCode":"static void requireNonBlank(String v, String name) {\n    if (v == null || v.isBlank()) throw new IllegalArgumentException(name + \" must be a non-blank string\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Lint manifests for empty-string values before distribution.","Fill all template placeholders and trim pasted values to avoid whitespace-only fields."],"tags":["theme-pack","manifest","validation","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"}