gtkrecentfilter: handle g_content_type_from_mime_type() returning NULL

Otherwise we get errors on g_content_type_is_a(). This happens mostly on Windows
because it only knows a limited set of mime types and tries to convert
them to file extensions without any fallback.
This commit is contained in:
Christoph Reiter
2019-06-30 13:59:13 +02:00
parent 041b64b9e2
commit 8a53ed9e55

View File

@ -746,10 +746,11 @@ gtk_recent_filter_filter (GtkRecentFilter *filter,
if (filter_info->mime_type != NULL)
{
gchar *filter_content_type, *rule_content_type;
gboolean match;
gboolean match = FALSE;
filter_content_type = g_content_type_from_mime_type (filter_info->mime_type);
rule_content_type = g_content_type_from_mime_type (rule->u.mime_type);
if (filter_content_type != NULL && rule_content_type != NULL)
match = g_content_type_is_a (filter_content_type, rule_content_type);
g_free (filter_content_type);
g_free (rule_content_type);