From 23ec85f25ecf38b8edc940b7f9b6c8c1c2b1914f Mon Sep 17 00:00:00 2001 From: snek Date: Sat, 9 Mar 2024 04:22:24 -0700 Subject: [PATCH] Fix crash on blank poses --- src/main/java/com/group_finity/mascot/animation/Pose.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/group_finity/mascot/animation/Pose.java b/src/main/java/com/group_finity/mascot/animation/Pose.java index a296bc6..47b55f5 100644 --- a/src/main/java/com/group_finity/mascot/animation/Pose.java +++ b/src/main/java/com/group_finity/mascot/animation/Pose.java @@ -20,7 +20,9 @@ public void next(final Mascot mascot) { mascot.getAnchor().y + dy() )); - MascotImage img = Main.getInstance() + // ignore if key is null (happens when pose has no image) + MascotImage img = imageKey() == null ? null : + Main.getInstance() .getImageSet(mascot.getImageSet()) .getImagePairs().get(imageKey()) .getImage(mascot.isLookRight());