Fix: MinecraftCapesAPI load profile only with existing UUID

This commit is contained in:
33 committed 2022-07-29 00:05:51 +08:00
1 parent e1cde0afc7
commit a3fa4e47c6
2 files changed
+47 -27

No files matched your search

@@ -49,8 +49,13 @@ public class MinecraftCapesAPI implements JsonAPILoader.IJsonAPI {
@Override
public String toJsonUrl(String root, String username) {
String uuid = MojangAPILoader.getMojangUuidByUsername(username);
//If uuid cannot be found, we won't load profile in this API.
if (uuid == null) {
return null;
}
//API url is `${root}${uuid}`
return root + MojangAPILoader.getMojangUuidByUsername(username);
return root + uuid;
}
@Override