From: Yegor Kozlov Date: Fri, 16 Nov 2012 12:58:45 +0000 (+0000) Subject: avoid warning: check if property node exists instead of throw/catch exception X-Git-Tag: 3.10-beta1~89 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2599c4f9dffc2b6b0d70d1dd9eb723f3f36c73d7;p=poi.git avoid warning: check if property node exists instead of throw/catch exception git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1410324 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/poi/POIDocument.java b/src/java/org/apache/poi/POIDocument.java index 8f177fec94..8f5c0aa3b0 100644 --- a/src/java/org/apache/poi/POIDocument.java +++ b/src/java/org/apache/poi/POIDocument.java @@ -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 {