From 8abc646ecba535ab0436f9ea9f16bcc79aaf0b42 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Mon, 29 Oct 2012 13:31:28 +0000 Subject: [PATCH] gio: handle g_vfs_get_supported_uri_schemes() returning NULL Handle g_vfs_get_supported_uri_schemes() returning NULL more gracefully, without criticals for passing NULL to g_strv_length(). --- gst/gio/gstgio.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gst/gio/gstgio.c b/gst/gio/gstgio.c index f10d4a4..96e1fc0 100644 --- a/gst/gio/gstgio.c +++ b/gst/gio/gstgio.c @@ -102,7 +102,11 @@ _internal_get_supported_protocols (gpointer data) gint i, j; schemes = g_vfs_get_supported_uri_schemes (g_vfs_get_default ()); - num = g_strv_length ((gchar **) schemes); + + if (schemes != NULL) + num = g_strv_length ((gchar **) schemes); + else + num = 0; if (num == 0) { GST_WARNING ("No GIO supported URI schemes found"); -- 2.7.4