aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java8
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);
+ }
}
}
}