From 2599c4f9dffc2b6b0d70d1dd9eb723f3f36c73d7 Mon Sep 17 00:00:00 2001 From: Yegor Kozlov Date: Fri, 16 Nov 2012 12:58:45 +0000 Subject: [PATCH] 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 --- src/java/org/apache/poi/POIDocument.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 { -- 2.39.5