Changeset 7322 in josm for trunk/src


Ignore:
Timestamp:
2014-07-21T16:30:18+02:00 (5 years ago)
Author:
akks
Message:

fix #10288: tagging-preset-tester NPE without data layer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetSelector.java

    r7210 r7322  
    4343import org.openstreetmap.josm.Main;
    4444import org.openstreetmap.josm.data.SelectionChangedListener;
     45import org.openstreetmap.josm.data.osm.DataSet;
    4546import org.openstreetmap.josm.data.osm.OsmPrimitive;
    4647import org.openstreetmap.josm.data.preferences.BooleanProperty;
     
    325326        boolean inTags = ckSearchInTags != null && ckSearchInTags.isSelected();
    326327
     328        DataSet ds = Main.main.getCurrentDataSet();
     329        Collection<OsmPrimitive> selected = (ds==null)? Collections.EMPTY_LIST : ds.getSelected();
    327330        final List<PresetClassification> result = classifications.getMatchingPresets(
    328                 text, onlyApplicable, inTags, getTypesInSelection(), Main.main.getCurrentDataSet().getSelected());
     331                text, onlyApplicable, inTags, getTypesInSelection(), selected);
    329332
    330333        lsResultModel.setPresets(result);
Note: See TracChangeset for help on using the changeset viewer.