You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by fa...@apache.org on 2026/01/14 20:06:31 UTC
(poi) branch trunk updated: XSSFReader: tolerate missing comments file (#996)
This is an automated email from the ASF dual-hosted git repository.
fanningpj pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/poi.git
The following commit(s) were added to refs/heads/trunk by this push:
new fd4d143d44 XSSFReader: tolerate missing comments file (#996)
fd4d143d44 is described below
commit fd4d143d4469f9b611a1c700e3dc121db288fdeb
Author: PJ Fanning <pj...@users.noreply.github.com>
AuthorDate: Wed Jan 14 21:06:26 2026 +0100
XSSFReader: tolerate missing comments file (#996)
---
.../main/java/org/apache/poi/xssf/eventusermodel/XSSFReader.java | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/eventusermodel/XSSFReader.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/eventusermodel/XSSFReader.java
index de4dbb207c..f945b3457f 100644
--- a/poi-ooxml/src/main/java/org/apache/poi/xssf/eventusermodel/XSSFReader.java
+++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/eventusermodel/XSSFReader.java
@@ -436,8 +436,16 @@ public class XSSFReader {
sheetPkg.getRelationshipsByType(XSSFRelation.SHEET_COMMENTS.getRelation());
if (!commentsList.isEmpty()) {
PackageRelationship comments = commentsList.getRelationship(0);
+ if (comments == null) {
+ LOGGER.warn("Failed to find sheet comments packageRelationship");
+ return null;
+ }
PackagePartName commentsName = PackagingURIHelper.createPartName(comments.getTargetURI());
PackagePart commentsPart = sheetPkg.getPackage().getPart(commentsName);
+ if (commentsPart == null) {
+ LOGGER.warn("Failed to find sheet comments: {}", commentsName);
+ return null;
+ }
return parseComments(commentsPart);
}
} catch (InvalidFormatException|IOException e) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org