diff --git a/src/org/olap4j/driver/xmla/proxy/XmlaOlap4jHttpProxy.java b/src/org/olap4j/driver/xmla/proxy/XmlaOlap4jHttpProxy.java index 55218cc..38fab94 100644 --- a/src/org/olap4j/driver/xmla/proxy/XmlaOlap4jHttpProxy.java +++ b/src/org/olap4j/driver/xmla/proxy/XmlaOlap4jHttpProxy.java @@ -130,10 +130,12 @@ public byte[] getResponse(URL url, String request) new ByteArrayOutputStream(); final byte[] buf = new byte[1024]; int count; - while ((count = errorStream.read(buf)) > 0) { - baos.write(buf, 0, count); + if (errorStream != null) { + while ((count = errorStream.read(buf)) > 0) { + baos.write(buf, 0, count); + } + errorStream.close(); } - errorStream.close(); baos.close(); } catch (IOException ex) { // Well, we tried. No point notifying the user here.