diff --git a/dspace-oai/src/main/java/org/dspace/xoai/util/ItemUtils.java b/dspace-oai/src/main/java/org/dspace/xoai/util/ItemUtils.java index ff566d598f25..1db31bcf8d47 100644 --- a/dspace-oai/src/main/java/org/dspace/xoai/util/ItemUtils.java +++ b/dspace-oai/src/main/java/org/dspace/xoai/util/ItemUtils.java @@ -401,7 +401,10 @@ public static Metadata retrieveMetadata(Context context, Item item) { if (restricted) { other.getField().add(createValue("restrictedAccess", "true")); } - other.getField().add(createValue("owningCollection", item.getOwningCollection().getName())); + // Because we reindex Solr, which is not done in vanilla + // The owning collection for workspace items is null + other.getField().add(createValue("owningCollection", + item.getOwningCollection() != null ? item.getOwningCollection().getName() : null)); other.getField().add(createValue("itemId", item.getID().toString())); metadata.getElement().add(other);