Ignore:
Timestamp:
2011-08-26T21:34:44+02:00 (13 years ago)
Author:
stoecker
Message:

fix #6592 - patch by simon04 - Exception showing history of incomplete objects

File:
1 edited

Legend:

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

    r4223 r4339  
    145145    protected boolean canShowAsLatest(OsmPrimitive primitive) {
    146146        if (primitive == null) return false;
    147         if (primitive.isNew()) return false;
     147        if (primitive.isNew() || !primitive.isUsable()) return false;
     148       
     149        //try creating a history primitive. if that fails, the primitive cannot be used.
     150        try {
     151            HistoryOsmPrimitive.forOsmPrimitive(primitive);
     152        } catch (Exception ign) {
     153            return false;
     154        }
     155
    148156        if (history == null) return false;
    149         // only show latest of the same version if it is
    150         // modified
     157        // only show latest of the same version if it is modified
    151158        if (history.getByVersion(primitive.getVersion()) != null)
    152159            return primitive.isModified();
Note: See TracChangeset for help on using the changeset viewer.