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/openslx/dozmod/gui/window/ImageDetailsWindow.java | |
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/openslx/dozmod/gui/window/ImageDetailsWindow.java')
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageDetailsWindow.java | 5 |
1 files changed, 4 insertions, 1 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)); |