fix: exception when trying to close undefined stream in finally block
This commit is contained in:
parent
938456e014
commit
ad04d90940
1 changed files with 8 additions and 8 deletions
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue