diff options
author | Nick Burch <nick@apache.org> | 2009-01-06 18:59:42 +0000 |
---|---|---|
committer | Nick Burch <nick@apache.org> | 2009-01-06 18:59:42 +0000 |
commit | f1b20beca1975cd53c5337ad94b7cc516c158129 (patch) | |
tree | 2070d879c2a0688a7e88f4f1e5d7698f70324540 | |
parent | 96c48a981c682b69a18ae5b77bfea2e07f4cc53f (diff) | |
download | poi-f1b20beca1975cd53c5337ad94b7cc516c158129.tar.gz poi-f1b20beca1975cd53c5337ad94b7cc516c158129.zip |
Fix bug #46472 - Avoid NPE in HPSFPropertiesExtractor when no properties exist
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@732058 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | src/documentation/content/xdocs/changes.xml | 1 | ||||
-rw-r--r-- | src/documentation/content/xdocs/status.xml | 1 | ||||
-rw-r--r-- | src/java/org/apache/poi/hpsf/extractor/HPSFPropertiesExtractor.java | 12 |
3 files changed, 9 insertions, 5 deletions
diff --git a/src/documentation/content/xdocs/changes.xml b/src/documentation/content/xdocs/changes.xml index 0536507411..63002aae8d 100644 --- a/src/documentation/content/xdocs/changes.xml +++ b/src/documentation/content/xdocs/changes.xml @@ -37,6 +37,7 @@ <!-- Don't forget to update status.xml too! --> <release version="3.5-beta5" date="2008-??-??"> + <action dev="POI-DEVELOPERS" type="fix">46472 - Avoid NPE in HPSFPropertiesExtractor when no properties exist</action> <action dev="POI-DEVELOPERS" type="fix">46479 - fixed bugs related to cached formula values and HSSFFormulaEvaluator.evaluateInCell()</action> <action dev="POI-DEVELOPERS" type="add">45031 - added implementation for CHOOSE() function</action> <action dev="POI-DEVELOPERS" type="fix">46361 - resolve licensing issues around the HDGF resource file, chunks_parse_cmds.tbl</action> diff --git a/src/documentation/content/xdocs/status.xml b/src/documentation/content/xdocs/status.xml index 6e72711b7a..8878fce6f8 100644 --- a/src/documentation/content/xdocs/status.xml +++ b/src/documentation/content/xdocs/status.xml @@ -34,6 +34,7 @@ <!-- Don't forget to update changes.xml too! --> <changes> <release version="3.5-beta5" date="2008-??-??"> + <action dev="POI-DEVELOPERS" type="fix">46472 - Avoid NPE in HPSFPropertiesExtractor when no properties exist</action> <action dev="POI-DEVELOPERS" type="fix">46479 - fixed bugs related to cached formula values and HSSFFormulaEvaluator.evaluateInCell()</action> <action dev="POI-DEVELOPERS" type="add">45031 - added implementation for CHOOSE() function</action> <action dev="POI-DEVELOPERS" type="fix">46361 - resolve licensing issues around the HDGF resource file, chunks_parse_cmds.tbl</action> diff --git a/src/java/org/apache/poi/hpsf/extractor/HPSFPropertiesExtractor.java b/src/java/org/apache/poi/hpsf/extractor/HPSFPropertiesExtractor.java index ecad5c05be..ca1cfb46dd 100644 --- a/src/java/org/apache/poi/hpsf/extractor/HPSFPropertiesExtractor.java +++ b/src/java/org/apache/poi/hpsf/extractor/HPSFPropertiesExtractor.java @@ -56,11 +56,13 @@ public class HPSFPropertiesExtractor extends POITextExtractor { // Now custom ones CustomProperties cps = dsi.getCustomProperties(); - Iterator keys = cps.keySet().iterator(); - while(keys.hasNext()) { - String key = (String)keys.next(); - String val = getPropertyValueText( cps.get(key) ); - text.append(key + " = " + val + "\n"); + if(cps != null) { + Iterator keys = cps.keySet().iterator(); + while(keys.hasNext()) { + String key = (String)keys.next(); + String val = getPropertyValueText( cps.get(key) ); + text.append(key + " = " + val + "\n"); + } } // All done |