diff options
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImagePublishedWindow.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImagePublishedWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImagePublishedWindow.java index 3fc119ec..5c1e498d 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImagePublishedWindow.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImagePublishedWindow.java @@ -9,6 +9,7 @@ import java.awt.event.MouseEvent; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.util.ArrayList; +import java.util.Iterator; import java.util.List; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; @@ -257,10 +258,11 @@ public class ImagePublishedWindow extends ImagePublishedWindowLayout implements // in case they somehow manage to get published. Remove this when we // support publishing images from other hypervisors. if (Session.hasFeature(Feature.MULTIPLE_HYPERVISORS)) { - for (int i = 0; i < imagePublishedList.size(); i++) { - ImageSummaryRead current = imagePublishedList.get(i); - if (current.virtId != TConst.VIRT_VMWARE) { - imagePublishedList.remove(i); + for (Iterator<ImageSummaryRead> iter = imagePublishedList.listIterator(); iter + .hasNext();) { + ImageSummaryRead current = iter.next(); + if (current != null && current.virtId != TConst.VIRT_VMWARE) { + iter.remove(); } } } |