Changeset 11417 in josm for trunk/src


Ignore:
Timestamp:
2016-12-23T15:30:46+01:00 (3 years ago)
Author:
Don-vip
Message:

fix #14152 - NPE

File:
1 edited

Legend:

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

    r10680 r11417  
    9494            TaggingPreset group = preset.group;
    9595            while (group != null) {
    96                 Collections.addAll(groups, group.getLocaleName().toLowerCase(Locale.ENGLISH).split("\\s"));
     96                addLocaleNames(groups, group);
    9797                group = group.group;
    9898            }
    99             Collections.addAll(names, preset.getLocaleName().toLowerCase(Locale.ENGLISH).split("\\s"));
     99            addLocaleNames(names, preset);
    100100            for (TaggingPresetItem item: preset.data) {
    101101                if (item instanceof KeyedItem) {
     
    115115                    }
    116116                }
     117            }
     118        }
     119
     120        private static void addLocaleNames(Collection<String> collection, TaggingPreset preset) {
     121            String locName = preset.getLocaleName();
     122            if (locName != null) {
     123                Collections.addAll(collection, locName.toLowerCase(Locale.ENGLISH).split("\\s"));
    117124            }
    118125        }
Note: See TracChangeset for help on using the changeset viewer.