add init check in recoll.Doc to avoid crash if connect() not called yet
This commit is contained in:
parent
851f7c5fa1
commit
1241a3ac5c
1 changed files with 5 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue