]> source.dussan.org Git - poi.git/commitdiff
add null check for XSLFShape
authorPJ Fanning <fanningpj@apache.org>
Sat, 12 Oct 2019 07:30:56 +0000 (07:30 +0000)
committerPJ Fanning <fanningpj@apache.org>
Sat, 12 Oct 2019 07:30:56 +0000 (07:30 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1868318 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/testcases/org/apache/poi/xslf/usermodel/TestXSLFShape.java
test-data/slideshow/ececapstonespring2012.pptx [new file with mode: 0644]

index 346e98922b12d58dd61925e7d63f48f731d89e3b..65ad0cace591bebe982764df3e3086dac4ad0e25 100644 (file)
@@ -83,6 +83,14 @@ public class TestXSLFShape {
         ppt.close();
     }
 
+    @Test
+    public void testProblemFile() throws IOException {
+        try (XMLSlideShow ppt = XSLFTestDataSamples.openSampleDocument("ececapstonespring2012.pptx")) {
+            List<XSLFSlide> slides = ppt.getSlides();
+            assertEquals(24, slides.size());
+        }
+    }
+
     @Test
     public void testCreateShapes() throws IOException {
         XMLSlideShow ppt = new XMLSlideShow();
diff --git a/test-data/slideshow/ececapstonespring2012.pptx b/test-data/slideshow/ececapstonespring2012.pptx
new file mode 100644 (file)
index 0000000..62cfcd4
Binary files /dev/null and b/test-data/slideshow/ececapstonespring2012.pptx differ