Skip to content
Snippets Groups Projects
Commit a699053e authored by aboeckle's avatar aboeckle
Browse files

OO-4375 Fixed revision path - null or out of bounds exception

parent f2915858
No related branches found
No related tags found
No related merge requests found
......@@ -157,10 +157,13 @@ public class LargeFilesController extends FormBasicController implements Extende
String[] path = contentRow.getPath().split("/");
StringBuilder sb = new StringBuilder(path[0]);
sb.append("/").append(path[1]);
if(path.length > 2) {
sb.append("/...");
if(path.length > 1) {
sb.append("/").append(path[1]);
if(path.length > 2) {
sb.append("/...");
}
}
FormLink pathInfo = uifactory.addFormLink("pathinfo_" + counter.incrementAndGet() , "pathInfo", sb.toString(), null, null, Link.NONTRANSLATED);
pathInfo.setUserObject(contentRow);
contentRow.setPathInfo(pathInfo);
......
......@@ -76,8 +76,8 @@ public class LargeFilesTableContentRow {
author = rev.getAuthor();
path = rev.getMetadata().getRelativePath();
revision = true;
fileType = WebappHelper.getMimeType(rev.getFilename()).split("/")[1];
fileCategory = WebappHelper.getMimeType(rev.getFilename()).split("/")[0];
fileType = WebappHelper.getMimeType(rev.getFilename()) != null ? WebappHelper.getMimeType(rev.getFilename()).split("/")[1] : "Unknown";
fileCategory = WebappHelper.getMimeType(rev.getFilename()) != null ? WebappHelper.getMimeType(rev.getFilename()).split("/")[0] : "Unknown";
createdAt = rev.getCreationDate();
lastModifiedAt = rev.getFileLastModified();
license = rev.getMetadata().getLicenseType();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment