Changeset 2775 in josm


Ignore:
Timestamp:
2010-01-08T14:04:20+01:00 (11 years ago)
Author:
Gubaer
Message:

fixed NPE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/BasicAuthenticationPreferencesPanel.java

    r2745 r2775  
    106106        try {
    107107            PasswordAuthentication pa = cm.lookup(RequestorType.SERVER);
    108             tfOsmUserName.setText(pa.getUserName() == null? "" : pa.getUserName());
    109             tfOsmPassword.setText(pa.getPassword() == null ? "" : String.valueOf(pa.getPassword()));
     108            if (pa == null) {
     109                tfOsmUserName.setText("");
     110                tfOsmPassword.setText("");
     111            } else {
     112                tfOsmUserName.setText(pa.getUserName() == null? "" : pa.getUserName());
     113                tfOsmPassword.setText(pa.getPassword() == null ? "" : String.valueOf(pa.getPassword()));
     114            }
    110115        } catch(CredentialsManagerException e) {
    111116            e.printStackTrace();
Note: See TracChangeset for help on using the changeset viewer.