From cfe07dca7662b597d5acf6ed2ad65347991d7a97 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Sat, 23 Sep 2023 22:07:15 -0700 Subject: [PATCH] Fix NPE in AdvancementProgress#getDateAwarded --- .../craftbukkit/advancement/CraftAdvancementProgress.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancementProgress.java b/paper-server/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancementProgress.java index aeb04a65a1..ec3b9cb901 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancementProgress.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancementProgress.java @@ -44,7 +44,7 @@ public class CraftAdvancementProgress implements AdvancementProgress { @Override public Date getDateAwarded(String criteria) { CriterionProgress criterion = this.handle.getCriterion(criteria); - return (criterion == null) ? null : Date.from(criterion.getObtained()); + return (criterion == null) ? null : criterion.getObtained() == null ? null : Date.from(criterion.getObtained()); // Paper - fix NPE if criterion isn't obtained } @Override