PRotect against null pointer when bitstrema has no name. See:

http://sourceforge.net/tracker/index.php?func=detail&aid=1939278&group_id=19984&atid=119984

git-svn-id: http://scm.dspace.org/svn/repo/branches/dspace-1_5_x@2932 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Mark Diggory
2008-05-14 18:17:48 +00:00
parent 901ff568e1
commit d98d07e898

View File

@@ -291,13 +291,15 @@ public class BitstreamReader extends AbstractReader implements Recyclable
this.bitstreamName = bitstream.getName();
// Trim any path information from the bitstream
int finalSlashIndex = bitstreamName.lastIndexOf("/");
if (finalSlashIndex > 0)
{
bitstreamName = bitstreamName.substring(finalSlashIndex+1);
}
if (bitstreamName != null)
{
int finalSlashIndex = bitstreamName.lastIndexOf("/");
if (finalSlashIndex > 0)
{
bitstreamName = bitstreamName.substring(finalSlashIndex+1);
}
}
// Log that the bitstream has been viewed.
log.info(LogManager.getHeader(context, "view_bitstream", "bitstream_id=" + bitstream.getID()));
}