From d8c3f6a4c1b99100a41965a0b7de14499dc763de Mon Sep 17 00:00:00 2001 From: Jan van Mansum Date: Thu, 6 Oct 2022 17:29:32 +0200 Subject: [PATCH] Initialize transient fields with empty HashMap instead of null --- .../iq/dataverse/authorization/users/AuthenticatedUser.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/edu/harvard/iq/dataverse/authorization/users/AuthenticatedUser.java b/src/main/java/edu/harvard/iq/dataverse/authorization/users/AuthenticatedUser.java index b2b5fa92e76..2cd28d9aac9 100644 --- a/src/main/java/edu/harvard/iq/dataverse/authorization/users/AuthenticatedUser.java +++ b/src/main/java/edu/harvard/iq/dataverse/authorization/users/AuthenticatedUser.java @@ -18,6 +18,7 @@ import java.io.Serializable; import java.sql.Timestamp; import java.util.Date; +import java.util.HashSet; import java.util.List; import java.util.Objects; import java.util.Set; @@ -135,10 +136,10 @@ public class AuthenticatedUser implements User, Serializable { private String mutedNotifications; @Transient - private Set mutedEmailsSet; + private Set mutedEmailsSet = new HashSet<>(); @Transient - private Set mutedNotificationsSet; + private Set mutedNotificationsSet = new HashSet<>(); @PrePersist void prePersist() {