diff --git a/dspace-rest/src/main/java/org/dspace/rest/common/Bitstream.java b/dspace-rest/src/main/java/org/dspace/rest/common/Bitstream.java index 24cc9fa770ca..25c2cb9b5655 100644 --- a/dspace-rest/src/main/java/org/dspace/rest/common/Bitstream.java +++ b/dspace-rest/src/main/java/org/dspace/rest/common/Bitstream.java @@ -8,6 +8,7 @@ package org.dspace.rest.common; import org.apache.log4j.Logger; +import org.dspace.core.Constants; import javax.xml.bind.annotation.XmlRootElement; import java.sql.SQLException; @@ -49,7 +50,13 @@ public void setup(org.dspace.content.Bitstream bitstream, String expand) throws expandFields = Arrays.asList(expand.split(",")); } - bundleName = bitstream.getBundles()[0].getName(); + //A logo bitstream might not have a bundle... + if(bitstream.getBundles() != null & bitstream.getBundles().length >= 0) { + if(bitstream.getParentObject().getType() == Constants.ITEM) { + bundleName = bitstream.getBundles()[0].getName(); + } + } + description = bitstream.getDescription(); format = bitstream.getFormatDescription(); sizeBytes = bitstream.getSize() + ""; diff --git a/dspace-rest/src/main/java/org/dspace/rest/common/Community.java b/dspace-rest/src/main/java/org/dspace/rest/common/Community.java index fb178cadbcda..dab5bce64fcc 100644 --- a/dspace-rest/src/main/java/org/dspace/rest/common/Community.java +++ b/dspace-rest/src/main/java/org/dspace/rest/common/Community.java @@ -168,4 +168,8 @@ public Community getParentCommunity() { public void setParentCommunity(Community parentCommunity) { this.parentCommunity = parentCommunity; } + + public Bitstream getLogo() { + return logo; + } }