Author: ab Date: Mon Oct 9 00:13:46 2006 New Revision: 454297 URL: http://svn.apache.org/viewvc?view=rev&rev=454297 Log: Fix NPE when document properties are null. Reported by Trym Asserson.
Modified: lucene/nutch/trunk/src/plugin/lib-parsems/src/java/org/apache/nutch/parse/ms/MSBaseParser.java Modified: lucene/nutch/trunk/src/plugin/lib-parsems/src/java/org/apache/nutch/parse/ms/MSBaseParser.java URL: http://svn.apache.org/viewvc/lucene/nutch/trunk/src/plugin/lib-parsems/src/java/org/apache/nutch/parse/ms/MSBaseParser.java?view=diff&rev=454297&r1=454296&r2=454297 ============================================================================== --- lucene/nutch/trunk/src/plugin/lib-parsems/src/java/org/apache/nutch/parse/ms/MSBaseParser.java (original) +++ lucene/nutch/trunk/src/plugin/lib-parsems/src/java/org/apache/nutch/parse/ms/MSBaseParser.java Mon Oct 9 00:13:46 2006 @@ -85,15 +85,17 @@ } catch (Exception e) { return new ParseStatus(ParseStatus.FAILED, - "Can't be handled as micrsosoft document. " + e) + "Can't be handled as Microsoft document. " + e) .getEmptyParse(this.conf); } // collect meta data Metadata metadata = new Metadata(); - title = properties.getProperty(DublinCore.TITLE); - properties.remove(DublinCore.TITLE); - metadata.setAll(properties); + if (properties != null) { + title = properties.getProperty(DublinCore.TITLE); + properties.remove(DublinCore.TITLE); + metadata.setAll(properties); + } if (text == null) { text = ""; } if (title == null) { title = ""; }