Ignore:
Timestamp:
2018-02-06T23:39:53+01:00 (22 months ago)
Author:
Don-vip
Message:

see #15880 - nicer exception

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java

    r13119 r13387  
    720720    @Override
    721721    public int getTileSize() {
    722         // no support for non-square tiles (tileHeight != tileWidth)
    723         // and for different tile sizes at different zoom levels
    724         Collection<Layer> projLayers = getLayers(null, tileProjection.toCode());
    725         if (!projLayers.isEmpty()) {
    726             return projLayers.iterator().next().tileMatrixSet.tileMatrix.get(0).tileHeight;
     722        if (tileProjection != null) {
     723            // no support for non-square tiles (tileHeight != tileWidth)
     724            // and for different tile sizes at different zoom levels
     725            Collection<Layer> projLayers = getLayers(null, tileProjection.toCode());
     726            if (!projLayers.isEmpty()) {
     727                return projLayers.iterator().next().tileMatrixSet.tileMatrix.get(0).tileHeight;
     728            }
    727729        }
    728730        // if no layers is found, fallback to default mercator tile size. Maybe it will work
     
    10591061    @Override
    10601062    public String getServerCRS() {
    1061         return tileProjection.toCode();
     1063        return tileProjection != null ? tileProjection.toCode() : null;
    10621064    }
    10631065}
Note: See TracChangeset for help on using the changeset viewer.