fix: exception when trying to close undefined stream in finally block

This commit is contained in:
Tobi Schäfer 2018-05-06 12:35:34 +02:00
parent 938456e014
commit ad04d90940

View file

@ -85,7 +85,7 @@ helma.Zip = function(file) {
var outStream = new java.io.BufferedOutputStream(new java.io.FileOutputStream(dest));
outStream.write(buf, 0, size);
} finally {
outStream.close();
if (outStream) outStream.close();
}
}
return null;
@ -322,7 +322,7 @@ helma.Zip = function(file) {
var outStream = new java.io.FileOutputStream(destFile);
bOutStream.writeTo(outStream);
} finally {
outStream.close();
if (outStream) outStream.close();
}
return;
};