Index: lams_central/src/java/org/lamsfoundation/lams/workspace/service/WorkspaceManagementService.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/workspace/service/WorkspaceManagementService.java,v diff -u -r1.61.2.11 -r1.61.2.12 --- lams_central/src/java/org/lamsfoundation/lams/workspace/service/WorkspaceManagementService.java 4 Dec 2016 12:33:31 -0000 1.61.2.11 +++ lams_central/src/java/org/lamsfoundation/lams/workspace/service/WorkspaceManagementService.java 4 Jan 2017 08:39:58 -0000 1.61.2.12 @@ -408,7 +408,7 @@ String contentType = folderContent.getResourceType(); if (FolderContentDTO.FOLDER.equals(contentType) && !designsOnly) { JSONObject subfolderJSON = new JSONObject(); - subfolderJSON.put("name", folderContent.getName()); + subfolderJSON.put("name", folderContent.getName() == null ? "" : folderContent.getName()); subfolderJSON.put("isRunSequencesFolder", WorkspaceFolder.RUN_SEQUENCES.equals(folderContent.getResourceTypeID() == null ? null : folderContent.getResourceTypeID().intValue())); @@ -428,7 +428,7 @@ : (designType.equals(WorkspaceManagementService.ALL_DESIGN_TYPES) || designType.equals(folderContent.getDesignType()))) { JSONObject learningDesignJSON = new JSONObject(); - learningDesignJSON.put("name", folderContent.getName()); + learningDesignJSON.put("name", folderContent.getName() == null ? "" : folderContent.getName()); learningDesignJSON.put("learningDesignId", folderContent.getResourceID()); learningDesignJSON.putOpt("type", folderContent.getDesignType()); learningDesignJSON.put("date", folderContent.getLastModifiedDateTime()); Index: lams_common/src/java/org/lamsfoundation/lams/workspace/dto/FolderContentDTO.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/workspace/dto/FolderContentDTO.java,v diff -u -r1.18.2.5 -r1.18.2.6 --- lams_common/src/java/org/lamsfoundation/lams/workspace/dto/FolderContentDTO.java 11 May 2016 07:07:29 -0000 1.18.2.5 +++ lams_common/src/java/org/lamsfoundation/lams/workspace/dto/FolderContentDTO.java 4 Jan 2017 08:39:59 -0000 1.18.2.6 @@ -137,16 +137,15 @@ } @Override - public int compareTo(FolderContentDTO o) { - if ((o != null) && (o instanceof FolderContentDTO)) { - FolderContentDTO anotherQuestion = o; - // folders go first, then sort by name - return resourceType.equals(anotherQuestion.getResourceType()) - ? name.compareToIgnoreCase(anotherQuestion.getName()) - : FolderContentDTO.FOLDER.equals(anotherQuestion.getResourceType()) ? -1 : 1; - } else { + public int compareTo(FolderContentDTO anotherContent) { + if (anotherContent == null) { return 1; } + // folders go first, then sort by name + return resourceType.equals(anotherContent.getResourceType()) + ? (name == null ? (anotherContent.getName() == null ? 0 : -1) + : (anotherContent.getName() == null ? 1 : name.compareToIgnoreCase(anotherContent.getName()))) + : (FolderContentDTO.FOLDER.equals(anotherContent.getResourceType()) ? -1 : 1); } /**