summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/param/pyparam.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source4/param/pyparam.c b/source4/param/pyparam.c
index 2d5a584fb2..0061eadc54 100644
--- a/source4/param/pyparam.c
+++ b/source4/param/pyparam.c
@@ -263,7 +263,11 @@ static PyObject *py_lp_ctx_default_service(py_talloc_Object *self, void *closure
static PyObject *py_lp_ctx_config_file(py_talloc_Object *self, void *closure)
{
- return PyString_FromString(lp_configfile(self->ptr));
+ const char *configfile = lp_configfile(self->ptr);
+ if (configfile == NULL)
+ Py_RETURN_NONE;
+ else
+ return PyString_FromString(configfile);
}
static PyGetSetDef py_lp_ctx_getset[] = {