From 6a27a4ea40649df0a8fb62f9c79da1f7c1ce5507 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 1 Dec 2007 12:18:09 +0000 Subject: [PATCH] fix exception when files is removed (should fix #1755) --- src/de/todesbaum/jsite/gui/ProjectFilesPage.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/de/todesbaum/jsite/gui/ProjectFilesPage.java b/src/de/todesbaum/jsite/gui/ProjectFilesPage.java index d8bac9c..4ae819f 100644 --- a/src/de/todesbaum/jsite/gui/ProjectFilesPage.java +++ b/src/de/todesbaum/jsite/gui/ProjectFilesPage.java @@ -31,8 +31,11 @@ import java.awt.event.KeyEvent; import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collections; +import java.util.HashSet; import java.util.Iterator; import java.util.List; +import java.util.Set; +import java.util.Map.Entry; import javax.swing.AbstractAction; import javax.swing.Action; @@ -400,13 +403,17 @@ public class ProjectFilesPage extends TWizardPage implements ActionListener, Lis rebuildContainerComboBox(); } }); + Set entriesToRemove = new HashSet(); Iterator filenames = project.getFileOptions().keySet().iterator(); while (filenames.hasNext()) { String filename = filenames.next(); if (!files.contains(filename)) { - project.setFileOption(filename, null); + entriesToRemove.add(filename); } } + for (String filename: entriesToRemove) { + project.setFileOption(filename, null); + } } else { JOptionPane.showMessageDialog(wizard, I18n.getMessage("jsite.project-files.scan-error"), null, JOptionPane.ERROR_MESSAGE); } -- 2.7.4