fixed a bug in error handling

This commit is contained in:
Kohsuke Kawaguchi
2012-04-24 16:14:13 -07:00
parent 53d09bb5d8
commit fff07bf70b

View File

@@ -320,7 +320,7 @@ public class GitHub {
*/
private InputStream wrapStream(HttpURLConnection uc, InputStream in) throws IOException {
String encoding = uc.getContentEncoding();
if (encoding==null) return in;
if (encoding==null || in==null) return in;
if (encoding.equals("gzip")) return new GZIPInputStream(in);
throw new UnsupportedOperationException("Unexpected Content-Encoding: "+encoding);