From 7bc8e272b17a8967090ed984a35a8de05edf8a34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Lindo?= Date: Tue, 5 Dec 2023 14:30:01 +0000 Subject: [PATCH] changes requested --- .../base/notifications/EmailIngestNotification.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/roda-core/roda-core/src/main/java/org/roda/core/plugins/base/notifications/EmailIngestNotification.java b/roda-core/roda-core/src/main/java/org/roda/core/plugins/base/notifications/EmailIngestNotification.java index 6589f61bcc..f1ab5714fc 100644 --- a/roda-core/roda-core/src/main/java/org/roda/core/plugins/base/notifications/EmailIngestNotification.java +++ b/roda-core/roda-core/src/main/java/org/roda/core/plugins/base/notifications/EmailIngestNotification.java @@ -95,9 +95,11 @@ public void notify(ModelService model, IndexService index, Job job, JobStats job StringBuilder builder = new StringBuilder(); for (IndexedReport report : reports) { - List reportsList = RodaCoreFactory.getModelService().retrieveJobReport(report.getJobId(), report.getId()).getReports(); - Report last = reportsList.get(reportsList.size() - 1); - builder.append(last.getPluginDetails()).append("\n\n"); + List reportsList = model.retrieveJobReport(report.getJobId(), report.getId()).getReports(); + if (reportsList != null && !reportsList.isEmpty()) { + Report last = reportsList.get(reportsList.size() - 1); + builder.append(last.getPluginDetails()).append("\n\n"); + } } scopes.put("failures", new Handlebars.SafeString(builder.toString()));