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;
if (hlmethods == 0) {
if (!self->query->makeDocAbstract(*(pydoc->doc), abstract)) {
PyErr_SetString(PyExc_EnvironmentError,
"rcl makeDocAbstract failed");
return 0;
}
// makeDocAbstract() can fail if there are no query terms (e.g. for
// a query like [ext:odt]. This should not cause an exception
self->query->makeDocAbstract(*(pydoc->doc), abstract);
} else {
HighlightData hldata;
sd->getTerms(hldata);