diff options
| author | Stephan Schwaer | 2015-10-29 16:56:02 +0100 |
|---|---|---|
| committer | Stephan Schwaer | 2015-10-29 16:56:02 +0100 |
| commit | e4028abea0e185401e79d86698c838f34110eb49 (patch) | |
| tree | 18940b696de74add94e5e485be0142764cb707a0 /dozentenmodul/src/main/java/org | |
| parent | [client] Make MapHelper null safe and do lectureCache refresh with QuickTimer... (diff) | |
| download | tutor-module-e4028abea0e185401e79d86698c838f34110eb49.tar.gz tutor-module-e4028abea0e185401e79d86698c838f34110eb49.tar.xz tutor-module-e4028abea0e185401e79d86698c838f34110eb49.zip | |
[client] Fix NPE for lectures without linked images.
Diffstat (limited to 'dozentenmodul/src/main/java/org')
| -rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageDetailsWindow.java | 5 | ||||
| -rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureListWindow.java | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageDetailsWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageDetailsWindow.java index 05120831..17a24626 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageDetailsWindow.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageDetailsWindow.java @@ -588,11 +588,14 @@ public class ImageDetailsWindow extends ImageDetailsWindowLayout implements UiFe // Count the number of linked lectures to the image int lectureCount = 0; for (LectureSummary lecture : LectureCache.get(false)) { + if (lecture == null || lecture.imageBaseId == null) + continue; if (lecture.imageBaseId.equals(image.imageBaseId)) lectureCount++; } linkedLectureCount.setText(Integer.toString(lectureCount)); - + btnShowLinkingLectures.setEnabled(lectureCount > 0); + // set the versions of the image to the table versionTable.setData(image.getVersions(), true); popupItemDelete.setEnabled(ImagePerms.canAdmin(image)); diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureListWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureListWindow.java index f8fb7ac2..faa3d98d 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureListWindow.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureListWindow.java @@ -488,10 +488,12 @@ public class LectureListWindow extends LectureListWindowLayout { } public void filterByImageBaseId(final String imageBaseId) { + if (imageBaseId == null) + return; RowFilter<ListModel<LectureSummary>, Integer> imageFilter = new RowFilter<ListModel<LectureSummary>, Integer>() { public boolean include(Entry<? extends ListModel<LectureSummary>, ? extends Integer> entry) { LectureSummary lecture = lectureTable.getModelRow(entry.getIdentifier()); - return lecture.imageBaseId.equals(imageBaseId); + return imageBaseId.equals(lecture.imageBaseId); } }; filterCbo.setSelectedIndex(-1); |
