Changeset 16794 in josm


Ignore:
Timestamp:
2020-07-18T07:57:39+02:00 (3 weeks ago)
Author:
simon04
Message:

fix #19496 - ImageProvider.getPadded: deprioritize multipolygon icon (avoid NPE)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/ImageProvider.java

    r16792 r16794  
    16001600        if (primitive.isTagged() && (!options.contains(GetPaddedOptions.NO_WAY_PRESETS) || OsmPrimitiveType.WAY != primitive.getType())) {
    16011601            final Optional<ImageIcon> icon = TaggingPresets.getMatchingPresets(primitive).stream()
    1602                     .sorted(Comparator.comparing(p ->
    1603                             p.iconName.contains("multipolygon") || p.types == null || p.types.isEmpty() ? Integer.MAX_VALUE : p.types.size()))
     1602                    .sorted(Comparator.comparing(p -> (p.iconName != null && p.iconName.contains("multipolygon"))
     1603                            || p.types == null || p.types.isEmpty() ? Integer.MAX_VALUE : p.types.size()))
    16041604                    .map(TaggingPreset::getImageResource)
    16051605                    .filter(Objects::nonNull)
Note: See TracChangeset for help on using the changeset viewer.