Changeset 12498 in josm for trunk/src/org/openstreetmap/josm


Ignore:
Timestamp:
2017-07-23T15:55:06+02:00 (7 years ago)
Author:
Don-vip
Message:

fix #15056 - NPE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/download/BookmarkList.java

    r12495 r12498  
    278278        final int n = MAX_CHANGESET_BOOKMARKS.get();
    279279        if (n > 0 && !im.isAnonymous()) {
    280             final ChangesetCacheManager ccm = ChangesetCacheManager.getInstance();
    281             final int userId = im.getUserInfo().getId();
    282             int found = 0;
    283             for (int i = 0; i < ccm.getModel().getRowCount() && found < n; i++) {
    284                 Changeset cs = ccm.getModel().getValueAt(i, 0);
    285                 if (cs.getUser().getId() == userId && cs.getBounds() != null) {
    286                     model.addElement(new ChangesetBookmark(cs));
    287                     found++;
     280            final UserInfo userInfo = im.getUserInfo();
     281            if (userInfo != null) {
     282                final ChangesetCacheManager ccm = ChangesetCacheManager.getInstance();
     283                final int userId = userInfo.getId();
     284                int found = 0;
     285                for (int i = 0; i < ccm.getModel().getRowCount() && found < n; i++) {
     286                    Changeset cs = ccm.getModel().getValueAt(i, 0);
     287                    if (cs.getUser().getId() == userId && cs.getBounds() != null) {
     288                        model.addElement(new ChangesetBookmark(cs));
     289                        found++;
     290                    }
    288291                }
    289292            }
Note: See TracChangeset for help on using the changeset viewer.