Changeset 11320 in josm for trunk/src/org


Ignore:
Timestamp:
2016-11-26T23:45:05+01:00 (8 years ago)
Author:
wiktorn
Message:

Better handle of null in readBytesFromStream.

See: #14033

File:
1 edited

Legend:

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

    r11319 r11320  
    13661366     *
    13671367     * @param stream input stream
    1368      * @return byte array of data in input stream
     1368     * @return byte array of data in input stream or null if stream is null
    13691369     * @throws IOException if any I/O error occurs
    13701370     */
    13711371    public static byte[] readBytesFromStream(InputStream stream) throws IOException {
     1372        if (stream == null) {
     1373            return null;
     1374        }
    13721375        try {
    13731376            ByteArrayOutputStream bout = new ByteArrayOutputStream(stream.available());
Note: See TracChangeset for help on using the changeset viewer.