Skip to content

Commit

Permalink
Fix NPE when the player has no cape
Browse files Browse the repository at this point in the history
  • Loading branch information
Moresteck committed Oct 25, 2024
1 parent 9d36ba7 commit 71fb8d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/uk/betacraft/legacyfix/util/SkinUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ public static SkinData fetchSkin(String uuid) {
byte[] cape;
byte[] skin = RequestUtil.readInputStream(skinUrl.openStream());

JSONObject capeObj = textures.getJSONObject("CAPE");
if (capeObj != null) {
if (textures.has("CAPE")) {
JSONObject capeObj = textures.getJSONObject("CAPE");
URL capeUrl = new URL(capeObj.getString("url"));

cape = RequestUtil.readInputStream(capeUrl.openStream());
Expand Down

0 comments on commit 71fb8d6

Please sign in to comment.