fix NPE in test code

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1873225 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2020-01-27 18:29:43 +00:00
parent 22a9be8706
commit d684fe1ebe
1 changed files with 3 additions and 2 deletions

View File

@ -75,12 +75,13 @@ public class BaseIntegrationTest {
throw e; throw e;
} catch (IOException e) { } catch (IOException e) {
// ignore some other ways of corrupted files // 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); Assume.assumeFalse("File " + file + " excluded because the Zip file is incomplete", true);
} }
// sometimes binary format has XML-format-extension... // 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); handleWrongOLE2XMLExtension(inputFile, e);
return; return;
} }