mirror of https://github.com/apache/poi.git
In NPOIFS, close the file we opened in more exception cases
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1055379 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
bf3222399a
commit
63f490ba72
|
@ -183,6 +183,14 @@ public class NPOIFSFileSystem extends BlockStore
|
|||
channel.close();
|
||||
}
|
||||
throw e;
|
||||
} catch(RuntimeException e) {
|
||||
// Comes from Iterators etc.
|
||||
// TODO Decide if we can handle these better whilst
|
||||
// still sticking to the iterator contract
|
||||
if(closeChannelOnError) {
|
||||
channel.close();
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue