aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorefefury <69400149+efefury@users.noreply.github.com>2023-07-23 12:43:51 +0200
committerGitHub <noreply@github.com>2023-07-23 20:43:51 +1000
commit2c58c09f12eb4cceeacbb31fcca4804198be140b (patch)
tree0b92e8883099440b3df54f52c47d07a88c2d2fca
parent34835697e889799e2b4e97c3bbf0ea73c04d5a64 (diff)
downloadNotEnoughUpdates-2c58c09f12eb4cceeacbb31fcca4804198be140b.tar.gz
NotEnoughUpdates-2c58c09f12eb4cceeacbb31fcca4804198be140b.tar.bz2
NotEnoughUpdates-2c58c09f12eb4cceeacbb31fcca4804198be140b.zip
fixed several crashes in pv (#784)
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewerUtils.java2
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/rift/RiftPage.java2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewerUtils.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewerUtils.java
index 38e26a80..ef4d5aa9 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewerUtils.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewerUtils.java
@@ -29,6 +29,7 @@ import io.github.moulberry.notenoughupdates.util.Constants;
import io.github.moulberry.notenoughupdates.util.JsonUtils;
import io.github.moulberry.notenoughupdates.util.Utils;
import net.minecraft.client.Minecraft;
+import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompressedStreamTools;
import net.minecraft.nbt.JsonToNBT;
@@ -242,6 +243,7 @@ public class ProfileViewerUtils {
}
public static ItemStack getPlayerData(String username) {
+ if (username == null) return new ItemStack(Blocks.stone);
String nameLower = username.toLowerCase();
if (!playerSkullCache.containsKey(nameLower)) {
playerSkullCache.put(nameLower, fallBackSkull());
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/rift/RiftPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/rift/RiftPage.java
index 0f2c4856..bff6834c 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/rift/RiftPage.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/rift/RiftPage.java
@@ -121,7 +121,7 @@ public class RiftPage extends GuiProfileViewerPage {
Utils.drawTexturedRect(guiLeft + 35, guiTop + 156, 20, 20, 0, 20 / 256f, 0, 20 / 256f, GL11.GL_NEAREST);
JsonObject deadCats = riftData.getAsJsonObject("dead_cats");
- if (!deadCats.entrySet().isEmpty()) {
+ if (!deadCats.entrySet().isEmpty() && deadCats.has("found_cata")) {
JsonArray foundCats = deadCats.getAsJsonArray("found_cats");
int size = foundCats.size();