gstmodule: Check for Py_None when setting a miniobject
authorThiago Santos <thiago.sousa.santos@collabora.co.uk>
Mon, 2 May 2011 19:59:30 +0000 (16:59 -0300)
committerThiago Santos <thiago.sousa.santos@collabora.co.uk>
Mon, 2 May 2011 20:05:27 +0000 (17:05 -0300)
Check if we got a None value before trying to use it as a
PyGstMiniObject.

https://bugzilla.gnome.org/show_bug.cgi?id=649227

gst/gstmodule.c

index fd66dff..2a37f8e 100644 (file)
@@ -75,7 +75,8 @@ pygstminiobject_to_gvalue (GValue * value, PyObject * obj)
 {
   PyGstMiniObject *self = (PyGstMiniObject *) obj;
 
-  gst_value_set_mini_object (value, self->obj);
+  gst_value_set_mini_object (value, obj == Py_None ? NULL : self->obj);
+
   return 0;
 }