You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ce...@apache.org on 2020/06/15 20:51:47 UTC

svn commit: r1878870 - /poi/trunk/src/java/org/apache/poi/hssf/model/LinkTable.java

Author: centic
Date: Mon Jun 15 20:51:47 2020
New Revision: 1878870

URL: http://svn.apache.org/viewvc?rev=1878870&view=rev
Log:
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

Modified:
    poi/trunk/src/java/org/apache/poi/hssf/model/LinkTable.java

Modified: poi/trunk/src/java/org/apache/poi/hssf/model/LinkTable.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/model/LinkTable.java?rev=1878870&r1=1878869&r2=1878870&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/model/LinkTable.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/model/LinkTable.java Mon Jun 15 20:51:47 2020
@@ -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);



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org