Skip to content

Commit b893031

Browse files
authored
Allow null titleId
1 parent 02f55d0 commit b893031

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main/java/cn/nukkit/utils/ClientChainData.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import cn.nukkit.network.encryption.EncryptionUtils;
44
import cn.nukkit.network.protocol.LoginPacket;
55
import com.google.gson.Gson;
6+
import com.google.gson.JsonElement;
67
import com.google.gson.JsonObject;
78
import com.google.gson.reflect.TypeToken;
89
import com.nimbusds.jose.JWSObject;
@@ -249,7 +250,11 @@ private void decodeChainData() {
249250
if (extra.has("displayName")) this.username = extra.get("displayName").getAsString();
250251
if (extra.has("identity")) this.clientUUID = UUID.fromString(extra.get("identity").getAsString());
251252
if (extra.has("XUID")) this.xuid = extra.get("XUID").getAsString();
252-
if (extra.has("titleId")) this.titleId = extra.get("titleId").getAsString();
253+
254+
JsonElement titleIdElement = extra.get("titleId");
255+
if (titleIdElement != null && !titleIdElement.isJsonNull()) {
256+
this.titleId = titleIdElement.getAsString();
257+
}
253258
}
254259

255260
if (chainMap.has("identityPublicKey")) {

0 commit comments

Comments
 (0)