Ignore:
Timestamp:
2012-03-21T23:15:32+01:00 (12 years ago)
Author:
simon04
Message:

fix #7532 - NPE in CredentialsManager

Location:
trunk/src/org/openstreetmap/josm/io/auth
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/auth/CredentialsManager.java

    r4690 r5111  
    9292    @Override
    9393    public void store(RequestorType requestorType, String host, PasswordAuthentication credentials) throws CredentialsAgentException {
    94         if (requestorType == RequestorType.SERVER && OsmApi.getOsmApi().getHost().equals(host)) {
     94        if (requestorType == RequestorType.SERVER && Utils.equal(OsmApi.getOsmApi().getHost(), host)) {
    9595            String username = credentials.getUserName();
    9696            if(username != null && !username.trim().isEmpty()) {
  • trunk/src/org/openstreetmap/josm/io/auth/JosmPreferencesCredentialAgent.java

    r4692 r5111  
    1515import org.openstreetmap.josm.gui.widgets.HtmlPanel;
    1616import org.openstreetmap.josm.io.OsmApi;
     17import org.openstreetmap.josm.tools.Utils;
    1718
    1819/**
     
    3435        switch(requestorType) {
    3536        case SERVER:
    36             if(OsmApi.getOsmApi().getHost().equals(host)) {
     37            if (Utils.equal(OsmApi.getOsmApi().getHost(), host)) {
    3738                user = Main.pref.get("osm-server.username", null);
    3839                password = Main.pref.get("osm-server.password", null);
     
    6667        switch(requestorType) {
    6768        case SERVER:
    68             if(OsmApi.getOsmApi().getHost().equals(host)) {
     69            if (Utils.equal(OsmApi.getOsmApi().getHost(), host)) {
    6970                Main.pref.put("osm-server.username", credentials.getUserName());
    7071                if (credentials.getPassword() == null) {
Note: See TracChangeset for help on using the changeset viewer.