Changeset 11198 in josm for trunk/src/org/openstreetmap/josm


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

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

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java

    r11173 r11198  
    817817            while (true) {
    818818                s = JOptionPane.showInputDialog(this, tr("Please enter the number of recently added tags to display"), s);
    819                 if (s == null) {
     819                if (s == null || s.isEmpty()) {
    820820                    return;
    821821                }
  • trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreference.java

    r10811 r11198  
    591591                            JOptionPane.QUESTION_MESSAGE
    592592                            );
    593                     if (s != null) {
     593                    if (s != null && !s.isEmpty()) {
    594594                        model.addElement(s);
    595595                    }
     
    617617                            list.getSelectedValue()
    618618                            );
    619                     if (s != null) {
     619                    if (s != null && !s.isEmpty()) {
    620620                        model.setElementAt(s, list.getSelectedIndex());
    621621                    }
  • 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.