python: makedocabstract failure should not cause exception

This commit is contained in:
Jean-Francois Dockes 2013-11-07 18:24:57 +01:00
parent 9b172b731c
commit 2b81076348

View File

@ -1248,11 +1248,9 @@ Query_makedocabstract(recoll_QueryObject* self, PyObject *args,PyObject *kwargs)
} }
string abstract; string abstract;
if (hlmethods == 0) { if (hlmethods == 0) {
if (!self->query->makeDocAbstract(*(pydoc->doc), abstract)) { // makeDocAbstract() can fail if there are no query terms (e.g. for
PyErr_SetString(PyExc_EnvironmentError, // a query like [ext:odt]. This should not cause an exception
"rcl makeDocAbstract failed"); self->query->makeDocAbstract(*(pydoc->doc), abstract);
return 0;
}
} else { } else {
HighlightData hldata; HighlightData hldata;
sd->getTerms(hldata); sd->getTerms(hldata);