Changeset 8967 in josm for trunk/src/org


Ignore:
Timestamp:
2015-10-29T17:47:43+01:00 (8 years ago)
Author:
Don-vip
Message:

fix #12027 - handle missing SVG files in help window

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/widgets/JosmImageView.java

    r8933 r8967  
    1010import java.net.URL;
    1111
     12import javax.swing.ImageIcon;
    1213import javax.swing.text.AttributeSet;
    1314import javax.swing.text.Element;
     
    127128            String urlStr = src.toExternalForm();
    128129            if (urlStr.endsWith(".svg") || urlStr.endsWith(".svg?format=raw")) {
    129                 imageField.set(this, new ImageProvider(urlStr).get().getImage());
     130                ImageIcon imgIcon = new ImageProvider(urlStr).setOptional(true).get();
     131                imageField.set(this, imgIcon != null ? imgIcon.getImage() : null);
    130132            } else {
    131133                Method loadImage = ImageView.class.getDeclaredMethod("loadImage");
Note: See TracChangeset for help on using the changeset viewer.