diff --git a/orcid-core/src/main/java/org/orcid/core/common/manager/impl/SummaryManagerImpl.java b/orcid-core/src/main/java/org/orcid/core/common/manager/impl/SummaryManagerImpl.java index 9594550614b..7e2bad43662 100644 --- a/orcid-core/src/main/java/org/orcid/core/common/manager/impl/SummaryManagerImpl.java +++ b/orcid-core/src/main/java/org/orcid/core/common/manager/impl/SummaryManagerImpl.java @@ -283,7 +283,7 @@ public RecordSummaryPojo getRecordSummaryPojo(String orcid) { for (EmailDomain ed : recordSummary.getEmailDomains().getEmailDomains()) { EmailDomainSummary eds = new EmailDomainSummary(); eds.setValue(ed.getValue()); - if (ed.getVerificationDate() != null) { + if (ed.getVerificationDate() != null && ed.getVerificationDate().getValue() != null) { eds.setVerificationDate(ed.getVerificationDate().toString()); } emailDomains.add(eds); @@ -524,7 +524,7 @@ public void generateEmailDomainsSummary(RecordSummary recordSummary, String orci for (ProfileEmailDomainEntity ped : emailDomains) { ed = new EmailDomain(); ed.setValue(ped.getEmailDomain()); - if (!ped.getGeneratedByScript()) { + if (!ped.getGeneratedByScript() && ped.getDateCreated() != null) { VerificationDate verificationDate = new VerificationDate(DateUtils.convertToXMLGregorianCalendar(ped.getDateCreated())); ed.setVerificationDate(verificationDate); } diff --git a/orcid-persistence/src/test/java/org/orcid/persistence/dao/NotificationDaoTest.java b/orcid-persistence/src/test/java/org/orcid/persistence/dao/NotificationDaoTest.java index 57cfb43dc69..9b2b70922ec 100644 --- a/orcid-persistence/src/test/java/org/orcid/persistence/dao/NotificationDaoTest.java +++ b/orcid-persistence/src/test/java/org/orcid/persistence/dao/NotificationDaoTest.java @@ -242,7 +242,6 @@ public void testFindNotificationsToSendLegacy() { for (Long id : ids) { notificationDao.remove(id); } - } private Long createNotification(String orcid, Date sentDate) {