]> source.dussan.org Git - poi.git/commitdiff
fix NPE in test code
authorPJ Fanning <fanningpj@apache.org>
Mon, 27 Jan 2020 18:29:43 +0000 (18:29 +0000)
committerPJ Fanning <fanningpj@apache.org>
Mon, 27 Jan 2020 18:29:43 +0000 (18:29 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1873225 13f79535-47bb-0310-9956-ffa450edef68

src/integrationtest/org/apache/poi/BaseIntegrationTest.java

index c1a49fda58ea2207668469b8c464dca8bf109704..7f60dbb74b785546c42edff6dfcac84dc9356b42 100644 (file)
@@ -75,12 +75,13 @@ public class BaseIntegrationTest {
                        throw e;
                } catch (IOException e) {
                        // ignore some other ways of corrupted files
-                       if(e.getMessage().contains("Truncated ZIP file")) {
+                       String message = e.getMessage();
+                       if(message != null && message.contains("Truncated ZIP file")) {
                                Assume.assumeFalse("File " + file + " excluded because the Zip file is incomplete", true);
                        }
 
                        // sometimes binary format has XML-format-extension...
-                       if(e.getMessage().contains("rong file format or file extension for OO XML file")) {
+                       if(message != null && message.contains("rong file format or file extension for OO XML file")) {
                                handleWrongOLE2XMLExtension(inputFile, e);
                                return;
                        }