Changeset 5111 in josm


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

fix #7532 - NPE in CredentialsManager

Location:
trunk/src/org/openstreetmap/josm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/io/CredentialDialog.java

    r4932 r5111  
    3838import org.openstreetmap.josm.io.OsmApi;
    3939import org.openstreetmap.josm.tools.ImageProvider;
     40import org.openstreetmap.josm.tools.Utils;
    4041import org.openstreetmap.josm.tools.WindowGeometry;
    4142
     
    4445    static public CredentialDialog getOsmApiCredentialDialog(String username, String password, String host, String saveUsernameAndPasswordCheckboxText) {
    4546        CredentialDialog dialog = new CredentialDialog(saveUsernameAndPasswordCheckboxText);
    46         if(OsmApi.getOsmApi().getHost().equals(host)) {
     47        if (Utils.equal(OsmApi.getOsmApi().getHost(), host)) {
    4748            dialog.prepareForOsmApiCredentials(username, password);
    4849        } else {
  • 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.