From 35b8fff808f9165bed27bbc61f90a2a478319dc1 Mon Sep 17 00:00:00 2001 From: Liam Date: Sat, 6 Jul 2024 00:00:53 +0100 Subject: [PATCH] fix npe --- src/main/java/cc/fascinated/bat/premium/PremiumProfile.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/cc/fascinated/bat/premium/PremiumProfile.java b/src/main/java/cc/fascinated/bat/premium/PremiumProfile.java index cb63d13..a798981 100644 --- a/src/main/java/cc/fascinated/bat/premium/PremiumProfile.java +++ b/src/main/java/cc/fascinated/bat/premium/PremiumProfile.java @@ -113,7 +113,7 @@ public class PremiumProfile extends Serializable { public void load(Document document, Gson gson) { this.activatedAt = (Date) document.getOrDefault("activatedAt", new Date()); this.expiresAt = (Date) document.getOrDefault("expiresAt", null); - this.type = document.containsKey("type") ? Type.valueOf(document.getString("type")) : null; + this.type = document.getString("type") != null ? Type.valueOf(document.getString("type")) : null; } @Override