Ignore:
Timestamp:
2017-10-07T22:39:09+02:00 (2 years ago)
Author:
Don-vip
Message:

fix #14961 - catch IAE when decoding base64 data

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/protocols/data/DataConnection.java

    r10931 r12937  
    88import java.net.URLConnection;
    99import java.util.Base64;
     10
     11import org.openstreetmap.josm.tools.bugreport.BugReport;
    1012
    1113/**
     
    3234    @Override
    3335    public InputStream getInputStream() throws IOException {
    34         return new ByteArrayInputStream(Base64.getDecoder().decode(url.toString().replaceFirst("^.*;base64,", "")));
     36        try {
     37            return new ByteArrayInputStream(Base64.getDecoder().decode(url.toString().replaceFirst("^.*;base64,", "")));
     38        } catch (IllegalArgumentException e) {
     39            throw BugReport.intercept(e).put("url", url);
     40        }
    3541    }
    3642}
Note: See TracChangeset for help on using the changeset viewer.