From 3ba7b59afc44d0ec5c74f5c16e6a5a9d8edaffaa Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Sat, 28 Feb 2015 17:36:19 +0000 Subject: [PATCH] Ensure that the core properties are there before saving them, in case they have not yet been lazy-created git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1662971 13f79535-47bb-0310-9956-ffa450edef68 --- src/ooxml/java/org/apache/poi/openxml4j/opc/ZipPackage.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ooxml/java/org/apache/poi/openxml4j/opc/ZipPackage.java b/src/ooxml/java/org/apache/poi/openxml4j/opc/ZipPackage.java index 62f26b754..888f50130 100644 --- a/src/ooxml/java/org/apache/poi/openxml4j/opc/ZipPackage.java +++ b/src/ooxml/java/org/apache/poi/openxml4j/opc/ZipPackage.java @@ -443,7 +443,9 @@ public final class ZipPackage extends Package { if (this.getPartsByRelationshipType(PackageRelationshipTypes.CORE_PROPERTIES).size() == 0 && this.getPartsByRelationshipType(PackageRelationshipTypes.CORE_PROPERTIES_ECMA376).size() == 0 ) { logger.log(POILogger.DEBUG,"Save core properties part"); - + + // Ensure that core properties are added if missing + getPackageProperties(); // Add core properties to part list ... addPackagePart(this.packageProperties); // ... and to add its relationship ...