[farsight2/master] Check for NULLs with g_return_val_if_fail in fs-plugin

Olivier Crête olivier.crete at collabora.co.uk
Tue Dec 23 15:24:13 PST 2008


---
 gst-libs/gst/farsight/fs-plugin.c |   14 +++-----------
 1 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/gst-libs/gst/farsight/fs-plugin.c b/gst-libs/gst/farsight/fs-plugin.c
index 9fd296c..7cdd011 100644
--- a/gst-libs/gst/farsight/fs-plugin.c
+++ b/gst-libs/gst/farsight/fs-plugin.c
@@ -260,18 +260,10 @@ fs_plugin_create_valist (const gchar *name, const gchar *type_suffix,
   GObject *object;
   FsPlugin *plugin;
 
-  fs_base_conference_init_debug ();
+  g_return_val_if_fail (name, NULL);
+  g_return_val_if_fail (type_suffix, NULL);
 
-  if (name == NULL) {
-    g_set_error (error, FS_ERROR, FS_ERROR_INVALID_ARGUMENTS,
-      "You need to pass a name");
-    return NULL;
-  }
-  if (type_suffix == NULL) {
-    g_set_error (error, FS_ERROR, FS_ERROR_INVALID_ARGUMENTS,
-      "You need to pass a type suffix");
-    return NULL;
-  }
+  fs_base_conference_init_debug ();
 
   plugin = fs_plugin_get_by_name (name, type_suffix);
 
-- 
1.5.6.5




More information about the farsight-commits mailing list