gcode-mirror / luke

Luke - Lucene Index Toolbox
https://code.google.com/p/luke/
0 stars 0 forks source link

Recent Changes to DocReconstructor sometimes cause Null Ref #17

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The DocReconstructor sometimes results in a Null Reference Exception.  The
problematic line is line 142 (svn trunk, 4/8/10):
     if (te == null || !te.term().field().equals(fld)) {

This line should be changes to:
      if (te == null || te.term() == null || !te.term().field().equals(fld)) {

Apparently, it is somehow possible to have a TermEnum here with a null
term.  I have seen this in several indexes, though I don't know the exact
scenario which reproduces an index which would cause this error.  The
indexes I've seen which cause this were created with Solr 1.4 (using Lucene
2.9.2).

Original issue reported on code.google.com by solrt...@gmail.com on 9 Apr 2010 at 3:55

GoogleCodeExporter commented 9 years ago
Thanks for finding this. I can confirm that compiling 1.0.1 with this patch 
solves the nullpointers when reconstructing documents with NO_NORMS or null 
terms (using Lucene 3.0.3)

Original comment by mtone...@gmail.com on 7 Feb 2011 at 2:35

GoogleCodeExporter commented 9 years ago
I applied this patch to branch-3x in rev. 57. This problem doesn't affect the 
trunk where enumerators behave differently. Thank you!

Original comment by sig...@gmail.com on 27 Apr 2011 at 10:25