From 116b8257be57eb1599127355fd9b60d87b087876 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Fri, 7 Oct 2022 06:06:03 +1100 Subject: Fix crash with pet overlay (#344) --- .../moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java | 8 +++++--- 1 file 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); + } } } } -- cgit