mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-16 14:33:09 +00:00
check null value of bitstream name before quoting name for regex
This commit is contained in:
@@ -403,7 +403,9 @@ public class BitstreamServiceImpl extends DSpaceObjectServiceImpl<Bitstream> imp
|
||||
|
||||
@Override
|
||||
public Bitstream getThumbnail(Context context, Bitstream bitstream) throws SQLException {
|
||||
Pattern pattern = Pattern.compile("^" + Pattern.quote(bitstream.getName()) + ".([^.]+)$");
|
||||
Pattern pattern = Pattern.compile("^" +
|
||||
(bitstream.getName() != null ? Pattern.quote(bitstream.getName()) : bitstream.getName())
|
||||
+ ".([^.]+)$");
|
||||
|
||||
for (Bundle bundle : bitstream.getBundles()) {
|
||||
for (Item item : bundle.getItems()) {
|
||||
|
Reference in New Issue
Block a user