From 29250a799d8a6a590c99534a22717b1b415e6849 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Fri, 27 Apr 2018 17:54:05 +0200 Subject: [client] fix bad public image list pruning.... --- .../org/openslx/dozmod/gui/window/ImagePublishedWindow.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'dozentenmodul/src/main/java/org') 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 iter = imagePublishedList.listIterator(); iter + .hasNext();) { + ImageSummaryRead current = iter.next(); + if (current != null && current.virtId != TConst.VIRT_VMWARE) { + iter.remove(); } } } -- cgit v1.2.3-55-g7522