add init check in recoll.Doc to avoid crash if connect() not called yet
This commit is contained in:
parent
5f590c7ca7
commit
e711f1e1a9
@ -614,6 +614,11 @@ Doc_setattr(recoll_DocObject *self, char *name, PyObject *value)
|
|||||||
PyErr_SetString(PyExc_AttributeError, "doc??");
|
PyErr_SetString(PyExc_AttributeError, "doc??");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
if (!rclconfig || !rclconfig->ok()) {
|
||||||
|
PyErr_SetString(PyExc_EnvironmentError,
|
||||||
|
"Configuration not initialized");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
#if PY_MAJOR_VERSION < 3
|
#if PY_MAJOR_VERSION < 3
|
||||||
if (PyString_Check(value)) {
|
if (PyString_Check(value)) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user