Ignore:
Timestamp:
2010-05-08T17:20:06+02:00 (9 years ago)
Author:
jttt
Message:

Fix #4388 JOSM told me i've found a bug while editing a relation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserModel.java

    r3083 r3221  
    871871        private HistoryOsmPrimitive clone;
    872872
     873        private String getUserName(OsmPrimitive primitive) {
     874            return primitive.getUser() == null?null:primitive.getUser().getName();
     875        }
     876
     877        private long getUserId(OsmPrimitive primitive) {
     878            return primitive.getUser() == null?0:primitive.getUser().getId();
     879        }
     880
    873881        public void visit(Node n) {
    874             clone = new HistoryNode(n.getId(), n.getVersion(), n.isVisible(),n.getUser().getName(), n.getUser().getId(), 0, n.getTimestamp(), n.getCoor());
     882            clone = new HistoryNode(n.getId(), n.getVersion(), n.isVisible(), getUserName(n), getUserId(n), 0, n.getTimestamp(), n.getCoor());
    875883            clone.setTags(n.getKeys());
    876884        }
    877885
    878886        public void visit(Relation r) {
    879             clone = new HistoryRelation(r.getId(), r.getVersion(), r.isVisible(),r.getUser().getName(), r.getUser().getId(), 0, r.getTimestamp());
     887            clone = new HistoryRelation(r.getId(), r.getVersion(), r.isVisible(), getUserName(r), getUserId(r), 0, r.getTimestamp());
    880888            clone.setTags(r.getKeys());
    881889            HistoryRelation hr = (HistoryRelation)clone;
     
    886894
    887895        public void visit(Way w) {
    888             clone = new HistoryWay(w.getId(), w.getVersion(), w.isVisible(),w.getUser().getName(), w.getUser().getId(), 0, w.getTimestamp());
     896            clone = new HistoryWay(w.getId(), w.getVersion(), w.isVisible(), getUserName(w), getUserId(w), 0, w.getTimestamp());
    889897            clone.setTags(w.getKeys());
    890898            for (Node n: w.getNodes()) {
Note: See TracChangeset for help on using the changeset viewer.