Ignore:
Timestamp:
2016-10-30T22:32:05+01:00 (9 years ago)
Author:
Don-vip
Message:

fix #13881 - handle cases where JOptionPane.showInputDialog returns an empty string

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/widgets/EditableList.java

    r10611 r11198  
    5050                    title,
    5151                    JOptionPane.QUESTION_MESSAGE);
    52             if (source != null) {
     52            if (source != null && !source.isEmpty()) {
    5353                ((DefaultListModel<String>) sourcesList.getModel()).addElement(source);
    5454            }
     
    6565                if (sourcesList.getModel().getSize() == 0) {
    6666                    String source1 = JOptionPane.showInputDialog(Main.parent, title, title, JOptionPane.QUESTION_MESSAGE);
    67                     if (source1 != null) {
     67                    if (source1 != null && !source1.isEmpty()) {
    6868                        ((DefaultListModel<String>) sourcesList.getModel()).addElement(source1);
    6969                    }
     
    8282                        JOptionPane.QUESTION_MESSAGE, null, null,
    8383                        sourcesList.getSelectedValue());
    84                 if (source2 != null) {
     84                if (source2 != null && !source2.isEmpty()) {
    8585                    ((DefaultListModel<String>) sourcesList.getModel()).setElementAt(source2, row);
    8686                }
Note: See TracChangeset for help on using the changeset viewer.