From: Jelmer Vernooij Date: Thu, 15 Jan 2009 20:16:31 +0000 (+0100) Subject: python/param: Cope with lp configfile being NULL. X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=2d85e23e06182c42a054477a62917a2176aaab16;p=metze%2Fsamba%2Fwip.git python/param: Cope with lp configfile being NULL. --- diff --git a/source4/param/pyparam.c b/source4/param/pyparam.c index 2d5a584fb270..0061eadc54e0 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[] = {