Changeset 5830 in josm for trunk/src


Ignore:
Timestamp:
2013-04-06T15:07:36+02:00 (12 years ago)
Author:
Don-vip
Message:

fix #8577 - Exception with empty SVG as image

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

Legend:

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

    r5762 r5830  
    867867            width = (int) Math.round(realWidth * scaleX);
    868868        }
     869        if (width == 0 || height == 0) {
     870            return null;
     871        }
    869872        BufferedImage img = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
    870873        Graphics2D g = img.createGraphics();
  • trunk/src/org/openstreetmap/josm/tools/ImageResource.java

    r4961 r5830  
    5555        if (svg != null) {
    5656            img = ImageProvider.createImageFromSvg(svg, dim);
     57            if (img == null) {
     58                return null;
     59            }
    5760            imgCache.put(dim, img);
    5861            return new ImageIcon(img);
Note: See TracChangeset for help on using the changeset viewer.