Changeset 18277 in josm


Ignore:
Timestamp:
2021-10-17T06:10:48+02:00 (3 years ago)
Author:
Don-vip
Message:

fix #21438 - NPE (patch by marcello)

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java

    r18211 r18277  
    546546    private static Set<String> getPresetValues(String key) {
    547547        Set<String> res = TaggingPresets.getPresetValues(key);
    548         if (res != null)
     548        if (!Utils.isEmpty(res))
    549549            return res;
    550550        if (additionalPresetsValueData.contains(key))
     
    561561     */
    562562    public static boolean isKeyInPresets(String key) {
    563         return TaggingPresets.getPresetValues(key) != null;
     563        return !Utils.isEmpty(TaggingPresets.getPresetValues(key));
    564564    }
    565565
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresets.java

    r18258 r18277  
    205205     * Return set of values for a key in the tagging presets
    206206     * @param key the key
    207      * @return set of values for a key in the tagging presets or null if none is found
     207     * @return set of values for a key in the tagging presets
    208208     */
    209209    public static Set<String> getPresetValues(String key) {
     
    211211        if (values != null)
    212212            return Collections.unmodifiableSet(values);
    213         return null;
     213        return Collections.emptySet();
    214214    }
    215215
Note: See TracChangeset for help on using the changeset viewer.