Browse Source

Throw an exception with more information instead of an NPE

This seems to be a corrupted document and shows up in regression tests and should at least be reported with some more information

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1878870 13f79535-47bb-0310-9956-ffa450edef68
tags/before_ooxml_3rd_edition
Dominik Stadler 4 years ago
parent
commit
fd7c926a4c
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      src/java/org/apache/poi/hssf/model/LinkTable.java

+ 4
- 0
src/java/org/apache/poi/hssf/model/LinkTable.java View File

@@ -513,6 +513,10 @@ final class LinkTable {
if (thisWbIndex < 0) {
throw new RuntimeException("Could not find 'internal references' EXTERNALBOOK");
}
if (_externSheetRecord == null) {
throw new RuntimeException("Did not have an external sheet record, having blocks: " +
_externalBookBlocks.length);
}

//Trying to find reference to this sheet
int i = _externSheetRecord.getRefIxForSheet(thisWbIndex, firstSheetIndex, lastSheetIndex);

Loading…
Cancel
Save