mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-18 07:23:08 +00:00
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:
@@ -291,13 +291,15 @@ public class BitstreamReader extends AbstractReader implements Recyclable
|
|||||||
this.bitstreamName = bitstream.getName();
|
this.bitstreamName = bitstream.getName();
|
||||||
|
|
||||||
// Trim any path information from the bitstream
|
// Trim any path information from the bitstream
|
||||||
int finalSlashIndex = bitstreamName.lastIndexOf("/");
|
if (bitstreamName != null)
|
||||||
if (finalSlashIndex > 0)
|
{
|
||||||
{
|
int finalSlashIndex = bitstreamName.lastIndexOf("/");
|
||||||
bitstreamName = bitstreamName.substring(finalSlashIndex+1);
|
if (finalSlashIndex > 0)
|
||||||
}
|
{
|
||||||
|
bitstreamName = bitstreamName.substring(finalSlashIndex+1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Log that the bitstream has been viewed.
|
// Log that the bitstream has been viewed.
|
||||||
log.info(LogManager.getHeader(context, "view_bitstream", "bitstream_id=" + bitstream.getID()));
|
log.info(LogManager.getHeader(context, "view_bitstream", "bitstream_id=" + bitstream.getID()));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user