Changeset 15948 in josm for trunk


Ignore:
Timestamp:
2020-02-27T19:52:44+01:00 (5 years ago)
Author:
simon04
Message:

see #18798, see #14088 - Add robustness for TagEditHelper.AbstractTagsDialog.findIcon

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java

    r15946 r15948  
    699699            }
    700700            virtual.put(key, value);
    701             final ImageIcon padded = ImageProvider.getPadded(virtual, ImageProvider.ImageSizes.LARGEICON.getImageDimension(),
    702                     EnumSet.of(ImageProvider.GetPaddedOptions.NO_DEFAULT, ImageProvider.GetPaddedOptions.NO_DEPRECATED));
    703             return Optional.ofNullable(padded);
     701            try {
     702                final ImageIcon padded = ImageProvider.getPadded(virtual, ImageProvider.ImageSizes.LARGEICON.getImageDimension(),
     703                        EnumSet.of(ImageProvider.GetPaddedOptions.NO_DEFAULT, ImageProvider.GetPaddedOptions.NO_DEPRECATED));
     704                return Optional.ofNullable(padded);
     705            } catch (Exception e) {
     706                Logging.warn("Failed to find icon for {0} {1}={2}", virtual.getType(), key, value);
     707                Logging.warn(e);
     708                return Optional.empty();
     709            }
    704710        }
    705711
Note: See TracChangeset for help on using the changeset viewer.