diff options
author | NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> | 2022-10-07 06:06:03 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-06 21:06:03 +0200 |
commit | 116b8257be57eb1599127355fd9b60d87b087876 (patch) | |
tree | 142154ce5e8bc0319eeacde7b029423fa2aadf48 | |
parent | 3d627400e94235df69327fe248f5c6f4fff07382 (diff) | |
download | NotEnoughUpdates-116b8257be57eb1599127355fd9b60d87b087876.tar.gz NotEnoughUpdates-116b8257be57eb1599127355fd9b60d87b087876.tar.bz2 NotEnoughUpdates-116b8257be57eb1599127355fd9b60d87b087876.zip |
Fix crash with pet overlay (#344)
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java index f0902921..776e3647 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java @@ -910,9 +910,11 @@ public class PetInfoOverlay extends TextOverlay { } else { setCurrentPet(newSelected); - Pet pet = getPetFromStack(event.slot.getStack().getTagCompound()); - if (pet != null) { - config.petMap.put(config.selectedPet, pet); + if (event.slot.getStack() != null && event.slot.getStack().getTagCompound() != null) { + Pet pet = getPetFromStack(event.slot.getStack().getTagCompound()); + if (pet != null) { + config.petMap.put(config.selectedPet, pet); + } } } } |