ext/gconf/gconf.c: Handle a NULL gconf key gracefully by rendering the default element.
authorJan Schmidt <thaytan@mad.scientist.com>
Fri, 27 Jul 2007 10:38:34 +0000 (10:38 +0000)
committerJan Schmidt <thaytan@mad.scientist.com>
Fri, 27 Jul 2007 10:38:34 +0000 (10:38 +0000)
Original commit message from CVS:
* ext/gconf/gconf.c: (gst_gconf_render_bin_with_default):
Handle a NULL gconf key gracefully by rendering the default element.

ChangeLog
ext/gconf/gconf.c

index cf9042b..344f527 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-07-27  Jan Schmidt  <thaytan@mad.scientist.com>
+
+       * ext/gconf/gconf.c: (gst_gconf_render_bin_with_default):
+       Handle a NULL gconf key gracefully by rendering the default element.
+
 2007-07-27  Wim Taymans  <wim.taymans@gmail.com>
 
        * gst/rtsp/gstrtspext.h:
index 81c1f55..2bda066 100644 (file)
@@ -173,12 +173,13 @@ GstElement *
 gst_gconf_render_bin_with_default (const gchar * bin,
     const gchar * default_sink)
 {
-  GstElement *ret;
+  GstElement *ret = NULL;
   GError *err = NULL;
 
-  ret = gst_parse_bin_from_description (bin, TRUE, &err);
+  if (bin != NULL)
+    ret = gst_parse_bin_from_description (bin, TRUE, &err);
 
-  if (err) {
+  if (ret == NULL || err != NULL) {
     ret = gst_element_factory_make (default_sink, NULL);
 
     if (!ret)