Commit 63a03859 authored by Matija Obreza's avatar Matija Obreza
Browse files

NPE

parent 578cbb14
......@@ -490,10 +490,11 @@ public class RepositoryFile extends BaseEntity implements BaseMetadata {
* @param originalFilename the new original filename
*/
public void setOriginalFilename(final String originalFilename) {
final int dotIndex = originalFilename.lastIndexOf(".");
if (originalFilename != null) {
final int dotIndex = originalFilename.lastIndexOf(".");
setExtension(dotIndex > 0 ? originalFilename.substring(dotIndex) : null);
}
this.originalFilename = originalFilename;
setExtension(dotIndex > 0 ? originalFilename.substring(dotIndex) : null);
}
/**
......
......@@ -182,8 +182,12 @@ public class RepositoryFileData implements BaseMetadata, Serializable {
repositoryFile.setRightsHolder(rightsHolder);
repositoryFile.setSubject(subject);
repositoryFile.setTitle(title);
repositoryFile.setOriginalFilename(originalFilename);
repositoryFile.setContentType(contentType);
if (originalFilename != null) {
repositoryFile.setOriginalFilename(originalFilename);
}
if (contentType != null) {
repositoryFile.setContentType(contentType);
}
}
public void setOriginalFilename(final String originalFilename) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment