mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 18:14:26 +00:00
Use getters instead of direct reference that may throw NPE. #2951
This commit is contained in:
@@ -761,9 +761,9 @@ public class DOIIdentifierProvider
|
||||
Item item = (Item) dso;
|
||||
|
||||
List<MetadataValue> metadata = itemService.getMetadata(item, MD_SCHEMA, DOI_ELEMENT, DOI_QUALIFIER, null);
|
||||
String leftPart = DOI.RESOLVER + SLASH + getPrefix() + SLASH + getNamespaceSeparator();
|
||||
for (MetadataValue id : metadata) {
|
||||
if (id.getValue().startsWith(
|
||||
DOI.RESOLVER + String.valueOf(SLASH) + PREFIX + String.valueOf(SLASH) + NAMESPACE_SEPARATOR)) {
|
||||
if (id.getValue().startsWith(leftPart)) {
|
||||
return doiService.DOIFromExternalFormat(id.getValue());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user