]> source.dussan.org Git - poi.git/commitdiff
avoid warning: check if property node exists instead of throw/catch exception
authorYegor Kozlov <yegor@apache.org>
Fri, 16 Nov 2012 12:58:45 +0000 (12:58 +0000)
committerYegor Kozlov <yegor@apache.org>
Fri, 16 Nov 2012 12:58:45 +0000 (12:58 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1410324 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/POIDocument.java

index 8f177fec947ae2e5621628f584b08b017adde2ba..8f5c0aa3b033e41d6f9f5dc5b6e2e8aa729723ee 100644 (file)
@@ -148,7 +148,7 @@ public abstract class POIDocument {
         */
        protected PropertySet getPropertySet(String setName) {
           //directory can be null when creating new documents
-          if(directory == null) return null;
+          if(directory == null || !directory.hasEntry(setName)) return null;
 
           DocumentInputStream dis;
           try {