diff options
Diffstat (limited to 'poi-ooxml')
-rw-r--r-- | poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java index 4b23b9ef63..23b659883f 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java @@ -3524,7 +3524,9 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { sheetComments = (Comments)createRelationship( XSSFRelation.SHEET_COMMENTS, getWorkbook().getXssfFactory(), -1); } - sheetComments.setSheet(this); + if (sheetComments != null) { + sheetComments.setSheet(this); + } } return sheetComments; } |