Index: trunk/src/org/openstreetmap/josm/data/oauth/OAuthAccessTokenHolder.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/oauth/OAuthAccessTokenHolder.java	(revision 18667)
+++ trunk/src/org/openstreetmap/josm/data/oauth/OAuthAccessTokenHolder.java	(revision 18671)
@@ -121,6 +121,7 @@
      */
     public IOAuthToken getAccessToken(String api, OAuthVersion version) {
-        api = URI.create(api).getHost();
-        if (this.tokenMap.containsKey(api)) {
+        // Sometimes the api might be sent as the host
+        api = Optional.ofNullable(URI.create(api).getHost()).orElse(api);
+        if (this.tokenMap.containsKey(api) && this.tokenMap.get(api).containsKey(version)) {
             Map<OAuthVersion, IOAuthToken> map = this.tokenMap.get(api);
             return map.get(version);
@@ -236,4 +237,6 @@
                 if (this.accessTokenKey != null && this.accessTokenSecret != null) {
                     cm.storeOAuthAccessToken(new OAuthToken(accessTokenKey, accessTokenSecret));
+                } else {
+                    cm.storeOAuthAccessToken(null);
                 }
                 for (Map.Entry<String, Map<OAuthVersion, IOAuthToken>> entry : this.tokenMap.entrySet()) {
