HMCL-dev/HMCL · error · JsonParseException

Game profile properties cannot be null

Error message

Game profile properties cannot be null

What it means

CompleteGameProfile.validate() throws JsonParseException when the deserialized game profile has null properties. The yggdrasil API contract requires every complete profile to carry a properties object (possibly empty), so HMCL treats its absence as a malformed server response.

Solutions

  1. Fix or replace the yggdrasil server so it returns a profile with a (possibly empty) properties object.
  2. Add "properties": {} to the JSON response if you control a mock/proxy server.
  3. Use a different profile source / re-fetch the profile from the official session server.

Example fix

// before (server response)
{"id":"069a79f4...","name":"Notch"}
// after
{"id":"069a79f4...","name":"Notch","properties":[]}
Defensive patterns

Strategy: validation

Validate before calling

JsonObject profile = JsonParser.parseString(responseText).getAsJsonObject();
if (!profile.has("properties")) {
    throw new JsonParseException("Server response missing properties field");
}

Try / catch

try {
    repository.fillProfile(profileId, callback);
} catch (JsonParseException e) {
    // mark profile as untrusted / refetch from another session server
}

Prevention

When it happens

Trigger: Parsing a /sessionserver/session/minecraft/profile/<uuid> response whose JSON omits the "properties" field, e.g. via GameProfileRepository.fillProfile or YggdrasilService profile fetching.

Common situations: Third-party or broken authlib-injector servers returning incomplete profile JSON; proxies stripping fields; API changes on untrusted yggdrasil-compatible servers.

Related errors


AI-assisted analysis of HMCL-dev/HMCL@24702dc5a0 (2026-09-10). Data as JSON: /api/errors/443e17f5065eb35c. Report an issue: GitHub.

Appendix: source

Thrown at HMCLCore/src/main/java/org/jackhuang/hmcl/auth/yggdrasil/CompleteGameProfile.java:56

    public CompleteGameProfile(UUID id, String name, Map<String, String> properties) {
        super(id, name);
        this.properties = Objects.requireNonNull(properties);
    }

    public CompleteGameProfile(GameProfile profile, Map<String, String> properties) {
        this(profile.getId(), profile.getName(), properties);
    }

    public Map<String, String> getProperties() {
        return properties;
    }

    @Override
    public void validate() throws JsonParseException {
        super.validate();

        if (properties == null)
            throw new JsonParseException("Game profile properties cannot be null");
    }
}

View on GitHub (pinned to 24702dc5a0)