Changeset 9680 in josm


Ignore:
Timestamp:
2016-01-29T22:52:01+01:00 (3 years ago)
Author:
Don-vip
Message:

fix NPE seen in unit tests

Location:
trunk
Files:
2 edited

Legend:

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

    r9526 r9680  
    200200    public void update(Observable o, Object arg) {
    201201        HistoryOsmPrimitive primitive = getPrimitive();
    202         Changeset cs = primitive.getChangeset();
    203         update(cs, model.isLatest(primitive), primitive.getTimestamp(), primitive.getVersion());
     202        if (primitive != null) {
     203            Changeset cs = primitive.getChangeset();
     204            update(cs, model.isLatest(primitive), primitive.getTimestamp(), primitive.getVersion());
     205        }
    204206    }
    205207
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/TMSLayerTest.java

    r9669 r9680  
    4949
    5050    private static void test(ImageryType expected, TMSLayer layer) {
    51         Main.main.addLayer(layer);
    5251        try {
     52            Main.main.addLayer(layer);
    5353            assertEquals(expected, layer.getInfo().getImageryType());
    5454        } finally {
Note: See TracChangeset for help on using the changeset viewer.