Index: trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java	(revision 11317)
+++ trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java	(revision 11320)
@@ -3,5 +3,7 @@
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
 
+import java.io.IOException;
 import java.util.Arrays;
 import java.util.Collections;
@@ -162,3 +164,14 @@
         assertEquals("<ul></ul>", Utils.joinAsHtmlUnorderedList(Collections.emptyList()));
     }
+
+    /**
+     * Tests if readBytesFromStream handles null streams (might happen when there is no data on error stream)
+     * @throws IOException
+     *
+     */
+    @Test
+    public void testNullStreamForReadBytesFromStream() throws IOException {
+        assertNull("Null on null stream", Utils.readBytesFromStream(null));
+    }
+
 }
