Changeset 7221 in josm for trunk/src


Ignore:
Timestamp:
2014-06-08T13:40:35+02:00 (6 years ago)
Author:
Don-vip
Message:

fix #10114 - NPE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java

    r7175 r7221  
    142142        URLConnection openConnection = Utils.openHttpConnection(getCapabilitiesUrl);
    143143        StringBuilder ba = new StringBuilder();
    144        
     144
    145145        try (
    146146            InputStream inputStream = openConnection.getInputStream();
     
    224224                || format.startsWith("image/bmp") && ImageIO.getImageReadersBySuffix("bmp").hasNext();
    225225    }
    226    
     226
    227227    static boolean imageFormatHasTransparency(final String format) {
    228         return format.startsWith("image/png") || format.startsWith("image/gif")
    229                 || format.startsWith("image/svg") || format.startsWith("image/tiff");
     228        return format != null && (format.startsWith("image/png") || format.startsWith("image/gif")
     229                || format.startsWith("image/svg") || format.startsWith("image/tiff"));
    230230    }
    231231
Note: See TracChangeset for help on using the changeset viewer.