Synchronize on projects when creating model
authorDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Wed, 23 Dec 2015 23:01:41 +0000 (00:01 +0100)
committerDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Wed, 23 Dec 2015 23:01:41 +0000 (00:01 +0100)
src/main/java/de/todesbaum/jsite/gui/KeyDialog.java

index 6f2c38e..9797708 100644 (file)
@@ -348,7 +348,9 @@ public class KeyDialog extends JDialog {
                final JLabel projectLabel = new JLabel(I18n.getMessage("jsite.key-dialog.label.project"));
                contentPanel.add(projectLabel, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.NONE, new Insets(12, 18, 0, 0), 0, 0));
 
-               projectsComboBox = new JComboBox(new ComboBoxModelList<Project>(projects));
+               synchronized (projects) {
+                       projectsComboBox = new JComboBox(new ComboBoxModelList<Project>(projects));
+               }
                projectsComboBox.addActionListener(new ActionListener() {
 
                        @Override