Prevent error caused by trying to add a posting for an empty term (created by unac on really weird data)

This commit is contained in:
Jean-Francois Dockes 2012-11-16 17:41:14 +01:00
parent 494c57ee9c
commit d68eacc172
2 changed files with 12 additions and 1 deletions

View file

@ -677,6 +677,10 @@ public:
// and remember relative.
m_ts->curpos = pos;
pos += m_ts->basepos;
// Don't try to add empty term Xapian doesnt like it... Safety check
// this should not happen.
if (term.empty())
return true;
string ermsg;
try {
// Index without prefix, using the field-specific weighting