summaryrefslogtreecommitdiffstats
path: root/source4/param
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2009-01-15 21:16:31 +0100
committerJelmer Vernooij <jelmer@samba.org>2009-01-15 21:16:31 +0100
commit2d85e23e06182c42a054477a62917a2176aaab16 (patch)
treefb8dc5f81c63084597a804aee4fe3161a382689a /source4/param
parent354a2e03abda1e4c31256472ae721eadbf695591 (diff)
downloadsamba-2d85e23e06182c42a054477a62917a2176aaab16.tar.gz
samba-2d85e23e06182c42a054477a62917a2176aaab16.tar.xz
samba-2d85e23e06182c42a054477a62917a2176aaab16.zip
python/param: Cope with lp configfile being NULL.
Diffstat (limited to 'source4/param')
-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 2d5a584fb27..0061eadc54e 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[] = {