From 595be4785da5047c363fca303e42ef53ace581c2 Mon Sep 17 00:00:00 2001 From: Philip Vissenaekens Date: Mon, 2 Jan 2017 15:22:32 +0100 Subject: [PATCH] 38351: bugfix empty item page on ProjectService exception --- .../objectmanager/RioxxProjectFunderEnricher.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/dspace/modules/xmlui/src/main/java/org/dspace/app/xmlui/objectmanager/RioxxProjectFunderEnricher.java b/dspace/modules/xmlui/src/main/java/org/dspace/app/xmlui/objectmanager/RioxxProjectFunderEnricher.java index 82d94d6..75e41a7 100644 --- a/dspace/modules/xmlui/src/main/java/org/dspace/app/xmlui/objectmanager/RioxxProjectFunderEnricher.java +++ b/dspace/modules/xmlui/src/main/java/org/dspace/app/xmlui/objectmanager/RioxxProjectFunderEnricher.java @@ -3,6 +3,7 @@ import java.util.*; import org.apache.commons.collections.*; import org.apache.commons.lang3.*; +import org.apache.log4j.*; import org.dspace.authority.*; import org.dspace.content.*; import org.dspace.core.*; @@ -13,6 +14,8 @@ */ public class RioxxProjectFunderEnricher implements MetaDatumEnricher { + private static Logger log = Logger.getLogger(RioxxProjectFunderEnricher.class); + private static final String RIOXX_SHEMA = "rioxxterms"; private static final String IDENTIFIER_ELEMENT = "identifier"; private static final String PROJECT_QUALIFIER = "project"; @@ -30,7 +33,15 @@ public void enrichMetadata(final Context context, final List metadataLi && StringUtils.equals(PROJECT_QUALIFIER, metadatum.qualifier)) { //Check if we can find the corresponding Funder Authority - ProjectAuthorityValue authorityValue = projectService.getProjectByAuthorityId(context, metadatum.authority); + ProjectAuthorityValue authorityValue = null; + + try { + authorityValue = projectService.getProjectByAuthorityId(context, metadatum.authority); + } + catch (IllegalArgumentException e) { + log.error(e.getMessage(), e); + } + if(authorityValue != null && authorityValue.getFunderAuthorityValue() != null) { String language = metadatum.language; int confidence = metadatum.confidence;