[bug-66257] add explicit POIXMLException when sheet package cannot be found

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1903972 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2022-09-10 14:40:50 +00:00
parent 229ad7d184
commit 04df5191fc
1 changed files with 3 additions and 0 deletions

View File

@ -349,6 +349,9 @@ public class XSSFReader {
String sheetId = xssfSheetRef.getId();
try {
PackagePart sheetPkg = sheetMap.get(sheetId);
if (sheetPkg == null) {
throw new POIXMLException("Failed to find sheet package for sheetId=" + sheetId);
}
return sheetPkg.getInputStream();
} catch (IOException e) {
throw new POIXMLException(e);