From 2d85e23e06182c42a054477a62917a2176aaab16 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 15 Jan 2009 21:16:31 +0100 Subject: python/param: Cope with lp configfile being NULL. --- source4/param/pyparam.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source4/param/pyparam.c') 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[] = { -- cgit