Ignore:
Timestamp:
2011-10-20T14:12:47+02:00 (15 years ago)
Author:
Don-vip
Message:

fix #6982 - broken TMS url leads to exceptions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java

    r4172 r4531  
    55
    66import java.awt.event.ActionEvent;
     7
     8import javax.swing.JOptionPane;
    79
    810import org.openstreetmap.josm.Main;
     
    2527    public void actionPerformed(ActionEvent e) {
    2628        if (!isEnabled()) return;
    27         Main.main.addLayer(ImageryLayer.create(info));
     29        try {
     30            Main.main.addLayer(ImageryLayer.create(info));
     31        } catch (IllegalArgumentException ex) {
     32            if (ex.getMessage() == null || ex.getMessage().isEmpty()) {
     33                throw ex;
     34            } else {
     35                JOptionPane.showMessageDialog(Main.parent,
     36                        ex.getMessage(), tr("Error"),
     37                        JOptionPane.ERROR_MESSAGE);
     38            }
     39        }
    2840    }
    2941
Note: See TracChangeset for help on using the changeset viewer.