Fix NPE in AdvancementProgress#getDateAwarded

This commit is contained in:
Jake Potrebic 2023-09-23 22:07:15 -07:00
parent fa87f62891
commit cfe07dca76

View file

@ -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