diff options
author | Yegor Kozlov <yegor@apache.org> | 2012-10-26 15:40:53 +0000 |
---|---|---|
committer | Yegor Kozlov <yegor@apache.org> | 2012-10-26 15:40:53 +0000 |
commit | 7c0f42451140353a24ee6df2b98755de20899158 (patch) | |
tree | 50c38c11ce3970dba063e8d633bf1d5ace1c881e /src/scratchpad | |
parent | 4575104984e6d74fe8756b709a79c0e86c3c0bef (diff) | |
download | poi-7c0f42451140353a24ee6df2b98755de20899158.tar.gz poi-7c0f42451140353a24ee6df2b98755de20899158.zip |
Bug #53707: SlideShow.addPicture declares IOException but throws HSLFException
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1402550 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/scratchpad')
-rw-r--r-- | src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java index 4561f8e4d3..ca7d839ebb 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/SlideShow.java @@ -853,13 +853,13 @@ public final class SlideShow { public int addPicture(File pict, int format) throws IOException { int length = (int) pict.length(); byte[] data = new byte[length]; - try { - FileInputStream is = new FileInputStream(pict); + FileInputStream is = null; + try { + is = new FileInputStream(pict); is.read(data); - is.close(); - } catch (IOException e) { - throw new HSLFException(e); - } + } finally { + if(is != null) is.close(); + } return addPicture(data, format); } |