Changeset 6902 in josm


Ignore:
Timestamp:
2014-03-08T23:36:09+01:00 (10 years ago)
Author:
Don-vip
Message:

fix #9791 - IllegalArgumentException when clicking an imagery link from HOT

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImageryHandler.java

    r6690 r6902  
    7373        }
    7474        GuiHelper.runInEDT(new Runnable() {
    75             @Override public void run() {
    76                 Main.main.addLayer(ImageryLayer.create(imgInfo));
     75            @Override
     76            public void run() {
     77                try {
     78                    Main.main.addLayer(ImageryLayer.create(imgInfo));
     79                } catch (IllegalArgumentException e) {
     80                    Main.error(e, false);
     81                }
    7782            }
    7883        });
     
    110115    @Override
    111116    protected void validateRequest() throws RequestHandlerBadRequestException {
    112         // Nothing to do
     117        String url = args.get("url");
     118        String type = args.get("type");
     119        try {
     120            ImageryLayer.create(new ImageryInfo(null, url, type, null, null));
     121        } catch (IllegalArgumentException e) {
     122            throw new RequestHandlerBadRequestException(e.getMessage(), e);
     123        }
    113124    }
    114125
Note: See TracChangeset for help on using the changeset viewer.