From: Tomas Mlcoch Date: Mon, 10 Jun 2013 12:01:24 +0000 (+0200) Subject: Python: xml_parser: Fix error when newpkgcb returns None. X-Git-Tag: upstream/0.2.1~95 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=95fe6d2b6d02c39d4c72b259f608f551e5f3f27f;p=services%2Fcreaterepo_c.git Python: xml_parser: Fix error when newpkgcb returns None. --- diff --git a/src/python/xml_parser-py.c b/src/python/xml_parser-py.c index 63fe514..faeafdd 100644 --- a/src/python/xml_parser-py.c +++ b/src/python/xml_parser-py.c @@ -70,8 +70,14 @@ c_newpkgcb(cr_Package **pkg, return CR_CB_RET_ERR; } - *pkg = Package_FromPyObject(result); - data->py_pkg = result; // Store reference to current package + if (result == Py_None) { + *pkg = NULL; + data->py_pkg = NULL; + Py_DECREF(result); + } else { + *pkg = Package_FromPyObject(result); + data->py_pkg = result; // Store reference to current package + } return CR_CB_RET_OK; }