diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/dev/SlideShowRecordDumper.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/dev/SlideShowRecordDumper.java index 005da13472..c7cecd8b37 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/dev/SlideShowRecordDumper.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/dev/SlideShowRecordDumper.java @@ -79,12 +79,12 @@ public final class SlideShowRecordDumper { String filename = args[ndx]; - SlideShowRecordDumper foo = new SlideShowRecordDumper(System.out, - filename, verbose, escher); - - foo.printDump(); - - foo.doc.close(); + SlideShowRecordDumper foo = new SlideShowRecordDumper(System.out, filename, verbose, escher); + try { + foo.printDump(); + } finally { + foo.doc.close(); + } } public static void printUsage() { diff --git a/poi-scratchpad/src/test/java/org/apache/poi/hslf/dev/TestSlideShowRecordDumper.java b/poi-scratchpad/src/test/java/org/apache/poi/hslf/dev/TestSlideShowRecordDumper.java index 2a45921a11..73bbd376fd 100644 --- a/poi-scratchpad/src/test/java/org/apache/poi/hslf/dev/TestSlideShowRecordDumper.java +++ b/poi-scratchpad/src/test/java/org/apache/poi/hslf/dev/TestSlideShowRecordDumper.java @@ -35,6 +35,8 @@ public class TestSlideShowRecordDumper extends BaseTestPPTIterating { @Test void testMain() throws IOException { + SlideShowRecordDumper.main(new String[] {}); + SlideShowRecordDumper.main(new String[] { HSLFTestDataSamples.getSampleFile("slide_master.ppt").getAbsolutePath(), });