[pybank] Handle returned NULL strings
- From: Johan Dahlin <johan src gnome org>
- To: svn-commits-list gnome org
- Subject: [pybank] Handle returned NULL strings
- Date: Tue, 2 Jun 2009 10:44:17 -0400 (EDT)
commit 54b6c0eae058044a17c87b26b20ea33316118589
Author: Tomeu Vizoso <tomeu sugarlabs org>
Date: Fri May 8 15:07:10 2009 +0200
Handle returned NULL strings
---
bank/bank-argument.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/bank/bank-argument.c b/bank/bank-argument.c
index ecd3def..97ac87d 100644
--- a/bank/bank-argument.c
+++ b/bank/bank-argument.c
@@ -190,14 +190,16 @@ pyg_argument_to_pyobject(GArgument *arg, GITypeInfo *type_info)
obj = PyFloat_FromDouble(arg->v_double);
break;
case GI_TYPE_TAG_UTF8:
- obj = PyString_FromString(arg->v_pointer);
+ if (arg->v_string == NULL)
+ obj = Py_None;
+ else
+ obj = PyString_FromString(arg->v_string);
break;
case GI_TYPE_TAG_INTERFACE:
obj = PyCObject_FromVoidPtr(arg->v_pointer, NULL);
break;
case GI_TYPE_TAG_ARRAY:
obj = Py_None;
- Py_INCREF(Py_None);
break;
default:
g_print("<GArg->PyO> GITypeTag %s is unhandled\n",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]