Index: /trunk/src/org/openstreetmap/josm/io/protocols/data/DataConnection.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/protocols/data/DataConnection.java	(revision 12936)
+++ /trunk/src/org/openstreetmap/josm/io/protocols/data/DataConnection.java	(revision 12937)
@@ -8,4 +8,6 @@
 import java.net.URLConnection;
 import java.util.Base64;
+
+import org.openstreetmap.josm.tools.bugreport.BugReport;
 
 /**
@@ -32,5 +34,9 @@
     @Override
     public InputStream getInputStream() throws IOException {
-        return new ByteArrayInputStream(Base64.getDecoder().decode(url.toString().replaceFirst("^.*;base64,", "")));
+        try {
+            return new ByteArrayInputStream(Base64.getDecoder().decode(url.toString().replaceFirst("^.*;base64,", "")));
+        } catch (IllegalArgumentException e) {
+            throw BugReport.intercept(e).put("url", url);
+        }
     }
 }
Index: /trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 12936)
+++ /trunk/src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 12937)
@@ -977,13 +977,13 @@
             String data = m.group(3);
             byte[] bytes;
-            if (";base64".equals(base64)) {
-                bytes = Base64.getDecoder().decode(data);
-            } else {
-                try {
+            try {
+                if (";base64".equals(base64)) {
+                    bytes = Base64.getDecoder().decode(data);
+                } else {
                     bytes = Utils.decodeUrl(data).getBytes(StandardCharsets.UTF_8);
-                } catch (IllegalArgumentException ex) {
-                    Logging.log(Logging.LEVEL_WARN, "Unable to decode URL data part: "+ex.getMessage() + " (" + data + ')', ex);
-                    return null;
-                }
+                }
+            } catch (IllegalArgumentException ex) {
+                Logging.log(Logging.LEVEL_WARN, "Unable to decode URL data part: "+ex.getMessage() + " (" + data + ')', ex);
+                return null;
             }
             String mediatype = m.group(1);
