From d43b188954d2152136767f9ceae0962243d6d125 Mon Sep 17 00:00:00 2001 From: "A. Walton" Date: Thu, 10 Jan 2008 13:25:41 +0000 Subject: [PATCH] Check for NULL content types. 2008-01-10 A. Walton * gdesktopappinfo.c: (g_app_info_get_all_for_type), (g_app_info_get_default_for_type): Check for NULL content types. svn path=/trunk/; revision=6290 --- gio/ChangeLog | 6 ++++++ gio/gdesktopappinfo.c | 9 +++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/gio/ChangeLog b/gio/ChangeLog index 0ce6cb5..7b2cb3f 100644 --- a/gio/ChangeLog +++ b/gio/ChangeLog @@ -1,3 +1,9 @@ +2008-01-10 A. Walton + + * gdesktopappinfo.c: (g_app_info_get_all_for_type), + (g_app_info_get_default_for_type): + Check for NULL content types. + 2008-01-10 Frederic Crozat * gunixmounts.c: add rpc_pipefs to systemfs list (#508309). diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c index 1f04ef4..5ffb0b7 100644 --- a/gio/gdesktopappinfo.c +++ b/gio/gdesktopappinfo.c @@ -1572,7 +1572,8 @@ app_info_in_list (GAppInfo *info, * * Gets a list of all #GAppInfo s for a given content type. * - * Returns: #GList of #GAppInfo s for given @content_type. + * Returns: #GList of #GAppInfo s for given @content_type + * or %NULL on error. **/ GList * g_app_info_get_all_for_type (const char *content_type) @@ -1580,6 +1581,8 @@ g_app_info_get_all_for_type (const char *content_type) GList *desktop_entries, *l; GList *infos; GDesktopAppInfo *info; + + g_return_val_if_fail (content_type != NULL, NULL); desktop_entries = get_all_desktop_entries_for_mime_type (content_type); @@ -1613,7 +1616,7 @@ g_app_info_get_all_for_type (const char *content_type) * * Gets the #GAppInfo that correspond to a given content type. * - * Returns: #GAppInfo for given @content_type. + * Returns: #GAppInfo for given @content_type or %NULL on error. **/ GAppInfo * g_app_info_get_default_for_type (const char *content_type, @@ -1621,6 +1624,8 @@ g_app_info_get_default_for_type (const char *content_type, { GList *desktop_entries, *l; GAppInfo *info; + + g_return_val_if_fail (content_type != NULL, NULL); desktop_entries = get_all_desktop_entries_for_mime_type (content_type); -- 2.7.4