summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src
diff options
context:
space:
mode:
authorralph isenmann2022-01-26 16:19:57 +0100
committerralph isenmann2022-01-26 16:19:57 +0100
commitc0934ea61ae968986f0308dd68a0d3d46e8ae7bf (patch)
treef98beba79b6c25a6f8b07a66be0076a45f3d1a9b /dozentenmodul/src
parent[CLIENT] fix nullpointer for images which does not have an latest imageVersionId (diff)
downloadtutor-module-c0934ea61ae968986f0308dd68a0d3d46e8ae7bf.tar.gz
tutor-module-c0934ea61ae968986f0308dd68a0d3d46e8ae7bf.tar.xz
tutor-module-c0934ea61ae968986f0308dd68a0d3d46e8ae7bf.zip
[CLIENT] fix isPageValid check for container
Diffstat (limited to 'dozentenmodul/src')
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/LectureImageListPage.java20
1 files changed, 12 insertions, 8 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/LectureImageListPage.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/LectureImageListPage.java
index b00bfbd7..a9e7676f 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/LectureImageListPage.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/LectureImageListPage.java
@@ -16,6 +16,7 @@ import org.openslx.dozmod.permissions.ImagePerms;
import org.openslx.dozmod.state.LectureWizardState;
import org.openslx.dozmod.thrift.cache.ImageCache;
import org.openslx.dozmod.util.ContainerUtils;
+import org.openslx.thrifthelper.TConst;
import org.openslx.util.QuickTimer;
import org.openslx.util.QuickTimer.Task;
@@ -91,16 +92,19 @@ public class LectureImageListPage extends LectureImageListPageLayout {
private boolean isPageValid() {
ImageSummaryRead selected = imageTable.getSelectedItem();
- if (ContainerUtils.isContainerImageLinked(selected)) {
- setErrorMessage(I18n.PAGE.getString("LectureImageList.WizardPage.errorMessage.containerLinkedWithLecture"));
- return false;
- }
- else if (ContainerUtils.isDataContainer(selected)) {
- setErrorMessage(I18n.PAGE.getString("LectureImageList.WizardPage.errorMessage.imageIsDataContainer"));
- return false;
+
+ if (selected != null && selected.virtId.equals(TConst.VIRT_DOCKER)) {
+ if (ContainerUtils.isContainerImageLinked(selected)) {
+ setErrorMessage(I18n.PAGE.getString("LectureImageList.WizardPage.errorMessage.containerLinkedWithLecture"));
+ return false;
+ }
+ else if (ContainerUtils.isDataContainer(selected)) {
+ setErrorMessage(I18n.PAGE.getString("LectureImageList.WizardPage.errorMessage.imageIsDataContainer"));
+ return false;
+ }
}
- else if (selected != null && selected.isValid && ImagePerms.canLink(selected)) {
+ if (selected != null && selected.isValid && ImagePerms.canLink(selected)) {
state.image = selected;
state.imageVersionId = selected.getLatestVersionId();
setDescription(I18n.PAGE.getString("LectureImageList.WizardPage.description"));