File tree Expand file tree Collapse file tree 4 files changed +15
-4
lines changed
src/main/java/xyz/theprogramsrc/supercoreapi Expand file tree Collapse file tree 4 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 1+ ## v4.2.7 Changelog:
2+ ```
3+ + Added more checks to the SkinTexture to avoid errors
4+ ```
5+
16## v4.2.6 Changelog:
27```
38* Fixed version in SuperCoreAPI Update Checker
Original file line number Diff line number Diff line change 66
77 <groupId >xyz.theprogramsrc</groupId >
88 <artifactId >SuperCoreAPI</artifactId >
9- <version >4.2.6 </version >
9+ <version >4.2.7 </version >
1010 <packaging >jar</packaging >
1111
1212 <name >SuperCoreAPI</name >
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ public void onCheckFail() {
2424
2525 @ Override
2626 public void onCheckSuccess (String lastVersion ) {
27- String currentVersion = "4.2.6 " ;
27+ String currentVersion = "4.2.7 " ;
2828 int latest = Integer .parseInt (lastVersion .split (" " )[0 ].replaceAll ("\\ ." , "" ));
2929 int current = Integer .parseInt (currentVersion .split (" " )[0 ].replaceAll ("\\ ." , "" ));
3030 if (latest > current ){
Original file line number Diff line number Diff line change @@ -64,7 +64,10 @@ public static SkinTexture fromMojang(String playerName) {
6464 String response = Utils .readWithInputStream ("https://api.mojang.com/users/profiles/minecraft/" + playerName );
6565 if (response == null )
6666 return null ;
67- String uuid = (new JsonParser ()).parse (response ).getAsJsonObject ().get ("id" ).getAsString ();
67+ JsonElement el = (new JsonParser ()).parse (response );
68+ if (el .isJsonNull ())
69+ return null ;
70+ String uuid = el .getAsJsonObject ().get ("id" ).getAsString ();
6871 String fullUUID = Utils .uuidToFullUUID (uuid );
6972 return fromMojang (UUID .fromString (fullUUID ));
7073 }
@@ -79,7 +82,10 @@ public static SkinTexture fromMojang(UUID uuid) {
7982 String response = Utils .readWithInputStream ("https://sessionserver.mojang.com/session/minecraft/profile/" + uuid .toString ().replace ("-" , "" ) + "?unsigned=false" );
8083 if (response == null )
8184 return null ;
82- JsonObject properties = (new JsonParser ()).parse (response ).getAsJsonObject ().get ("properties" ).getAsJsonArray ().get (0 ).getAsJsonObject ();
85+ JsonElement el = (new JsonParser ()).parse (response );
86+ if (el .isJsonNull ())
87+ return null ;
88+ JsonObject properties = el .getAsJsonObject ().get ("properties" ).getAsJsonArray ().get (0 ).getAsJsonObject ();
8389 String value = properties .get ("value" ).getAsString ();
8490 return new SkinTexture (base64ToUrl (value ));
8591 }
You can’t perform that action at this time.
0 commit comments