Ticket #24672: patch_24672.txt

File patch_24672.txt, 1.0 KB (added by DanProgs <Abenteurer.2901@…>, 4 days ago)
Line 
1### Eclipse Workspace Patch 1.0
2#P JMapViewer
3Index: src/org/openstreetmap/gui/jmapviewer/tilesources/BingAerialTileSource.java
4===================================================================
5--- src/org/openstreetmap/gui/jmapviewer/tilesources/BingAerialTileSource.java (revision 36495)
6+++ src/org/openstreetmap/gui/jmapviewer/tilesources/BingAerialTileSource.java (working copy)
7@@ -102,9 +103,10 @@
8
9 @Override
10 public String getTileUrl(int zoom, int tilex, int tiley) throws IOException {
11- // make sure that attribution is loaded. otherwise subdomains is null.
12- if (getAttribution() == null)
13- throw new IOException("Attribution is not loaded yet");
14+ // Fail-fast with a clear message
15+ if (getAttribution() == null || subdomains == null || subdomains.length == 0) {
16+ throw new IOException("Attribution or subdomains not initialized");
17+ }
18
19 int t = (zoom + tilex + tiley) % subdomains.length;
20 String subdomain = subdomains[t];
21