Index: trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java	(revision 13876)
+++ trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java	(revision 13878)
@@ -432,8 +432,13 @@
                         // TODO should we handle also POST?
                         if ("GET".equalsIgnoreCase(mode) && getMapUrl != null && !"".equals(getMapUrl)) {
-                            if (getMapUrl.endsWith("?")) {
-                                this.getMapUrl = getMapUrl;
-                            } else {
-                                this.getMapUrl = getMapUrl + "?";
+                            try {
+                                String query = (new URL(getMapUrl)).getQuery();
+                                if (query == null || query.isEmpty()) {
+                                    this.getMapUrl = getMapUrl + "?";
+                                } else {
+                                    this.getMapUrl = getMapUrl;
+                                }
+                            } catch (MalformedURLException e) {
+                                throw new XMLStreamException(e);
                             }
                         }
