Subject: [PATCH] Fix #23721: JOSM hangs indefinitely if Bing API unavailable
---
Index: src/org/openstreetmap/gui/jmapviewer/tilesources/BingAerialTileSource.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/gui/jmapviewer/tilesources/BingAerialTileSource.java b/src/org/openstreetmap/gui/jmapviewer/tilesources/BingAerialTileSource.java
--- a/src/org/openstreetmap/gui/jmapviewer/tilesources/BingAerialTileSource.java	(revision 36265)
+++ b/src/org/openstreetmap/gui/jmapviewer/tilesources/BingAerialTileSource.java	(date 1718049511515)
@@ -286,14 +286,16 @@
                 }
             }
         }
-        try {
-            return attributions.get();
-        } catch (ExecutionException ex) {
-            throw new JMapViewerRuntimeException(ex);
-        } catch (InterruptedException ign) {
-            LOG.log(Level.SEVERE, "InterruptedException: {0}", ign.getMessage());
-            LOG.log(Level.FINE, ign.getMessage(), ign);
-            Thread.currentThread().interrupt();
+        if (attributions.isDone()) {
+            try {
+                return attributions.get();
+            } catch (ExecutionException ex) {
+                throw new JMapViewerRuntimeException(ex);
+            } catch (InterruptedException ign) {
+                LOG.log(Level.SEVERE, "InterruptedException: {0}", ign.getMessage());
+                LOG.log(Level.FINE, ign.getMessage(), ign);
+                Thread.currentThread().interrupt();
+            }
         }
         return null;
     }
